Page 1 of 1

Generate Time Stamp Value

Posted: Wed Sep 24, 2008 1:57 am
by Vivek Vazarkar
Hi All,

Please let me know how to generate the Time stamp value in the transformer stage in the 2008-09-24 03:35:55 format.


Thanks,
Vivek

Posted: Wed Sep 24, 2008 2:00 am
by WoMaWil
what do you have as input and how does it look like?

Posted: Wed Sep 24, 2008 2:02 am
by ray.wurlod
This is something you will need over and over: the ability to generate the current date/time as a timestamp. I advise that you create a Transform or even a Routine. I call mine NowAsTimestamp.

Code: Select all

Oconv(Date(),"D-YMD[4,2,2]") : " " : Oconv(Time(),"MTS:")
If you want to generate a timestamp from other input, please advise what that input looks like, as Wolfgang already asked. Or simply adapt the above code.

Posted: Wed Sep 24, 2008 2:35 am
by Vivek Vazarkar
WoMaWil wrote:what do you have as input and how does it look like?
Hi Thanks for your replay ?

Source is the .txt file having 5 columns and target is having 6 columns.

There is a difference of 1 columns n that column I want to populate with current date with time stamp.

Posted: Wed Sep 24, 2008 3:08 am
by sachin1
hello,
please try this

Oconv(@DATE, "D-YMD[4,2,2]"):' ':Oconv(@time, "MTS")

Posted: Wed Sep 24, 2008 5:05 am
by arunkumarmm
You can even use DSJobStartTime in DSMACRO which will give you the timestamp of when the job has started.

Posted: Thu Sep 25, 2008 5:10 am
by tennetiharika
Jus select dsjobtimestamp from the DS macros.The tool will generate it for u.We need not worry at all

Posted: Thu Sep 25, 2008 5:14 am
by ray.wurlod
U didn't ask about generating timestamps.

The user may not want the job start timestamp - the value required may be "now". For long-running jobs this can be quite different from the job start timestamp. In this case prefer Date() and Time() functions, because the system variables @DATE and @TIME are set when the job starts and are not updated.