Page 1 of 1

Current Timestamp

Posted: Tue May 18, 2004 4:16 pm
by kab123
Hi All,

I have to create a new column and have to give the current timestamp for that. what expression/Derivation I need to give with that.
Database is SYBASE.

Thanks in advance .
abhi

Posted: Tue May 18, 2004 4:39 pm
by ray.wurlod
Current timestamp in ISO8601 format is given by

Code: Select all

Oconv(Date(), "D-YMD[4,2,2]"):" ":Oconv(Time(), "MTS:")
Substitute system variables @DATE and @TIME for Date() and Time() if you want "current timestamp" as at the start time for the job, instead of as at "now".

Sybase OC expects YYYYMMDD HH:MM:SS.sss as the format. If you don't need milliseconds use

Code: Select all

Oconv(Date(), "D-YMD[4,2,2]":@VM:"MCN"):" ":Oconv(Time(), "MTS:"):".000"
If you do need milliseconds, you will need to create a Routine, in which you enabled $OPTIONS TIME.MILLISECOND and then use SYSTEM(12) to obtain the number of milliseconds since midnight. And that's assuming your operating system can deliver clock milliseconds.

Posted: Tue May 18, 2004 4:45 pm
by kab123
Thanks Ray

Abhi