Page 1 of 1

date to timestamp

Posted: Wed May 18, 2011 1:40 am
by Nagac
Hi all,

Could you please let me know how can I do a Date to Timestamp conversion. I have a job where I have a date format and need to convert to Time stamp format which is output format. I know we can do timestamp to date using TimestampToDate function. But iam not sure how we can do this. i would like to put zero's in time portion. Please help me out.

Regards
Naresh

Posted: Wed May 18, 2011 4:07 am
by ray.wurlod
TimestampToDate() won't help - it goes the wrong way. Do you really need a Timestamp data type, or do you need a string formatted like a timestamp?

Re: date to timestamp

Posted: Wed May 18, 2011 6:16 am
by soumya.buna
Hi,

if you need default time to be added to the date part then you can go for following conversion.

StringToTimestamp(DateToString(DSLink2.da,"%yyyy-%mm-%dd") : ' 00:00:00',"%yyyy-%mm-%dd %hh:%nn:%ss")

thanks.

Re: date to timestamp

Posted: Thu May 19, 2011 9:05 am
by Sampath
Use Timestamp data type and use function in transformer stage DatetoTimestamp(ColumnName)