Needed current date in CCYY-MM-DD-HH.MM.SS.NNNNNN format

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Needed current date in CCYY-MM-DD-HH.MM.SS.NNNNNN format

Post by HemaV »

Hi All,

when i used CurrentTimestampMS() in my transformer i'm getting the date as
"2013-04-16 07:46:40.626082" means the format is "YYYY-MM-DD HH:MM:SS.NNNNNN"

But I wanted the format to be in "CCYY-MM-DD-HH.MM.SS.NNNNNN'

Could you please let me know How to do achive this in transformer stage.


Thanks in Advance,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

CurrentTimestamp() is going to generate a binary timestamp. Format only comes into the picture when you want to convert that to a string. The View Data utility necessarily has to convert to string so we humans can see the value.

The easy options are to specify a format string with TimestampToString() function, or to use a Convert() function to change the " " to "-" once the timestamp has been converted to string.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply