Page 1 of 2

Date Conversion

Posted: Wed Jun 28, 2006 12:04 pm
by thatiprashant
hi,,

i have got a query where in i will get date and timestamp like
12/10/2005 11:20:21
i need to transform that into two colums in the next stage with date and time as a seperate columns.

help is appreciated
thanks

Posted: Wed Jun 28, 2006 12:13 pm
by us1aslam1us
you can use substrings function to do that.

Thanks
Sam

Posted: Wed Jun 28, 2006 1:20 pm
by DSguru2B
Or use the Field() function.

Or

Posted: Wed Jun 28, 2006 1:43 pm
by travis
You could also do DateField[1,10] in the first column and DateField[12,8]

Posted: Wed Jun 28, 2006 3:38 pm
by ray.wurlod
DateFromTimestamp() and TimeFromTimestamp() functions seem to be the obvious candidates. You will need a format string if your timestamp does not correspond to your project's default format.

Posted: Thu Jun 29, 2006 6:57 am
by thatiprashant
ray.wurlod wrote:DateFromTimestamp() and TimeFromTimestamp() functions seem to be the obvious candidates. You will need a format string if your timestamp does not correspond to your project's default format. ...
thanks for ur reply ray,,but i dont have DateFromTimestamp() in my DS7.5.1,, can you please explain more as i am very new to DS

Posted: Thu Jun 29, 2006 6:59 am
by ray.wurlod
You do have it. Use the Expression Editor in a Transformer stage. It will appear in among the available Functions.

Posted: Thu Jun 29, 2006 7:09 am
by thatiprashant
ray.wurlod wrote:You do have it. Use the Expression Editor in a Transformer stage. It will appear in among the available Functions. ...
thanks for ur reply,,i found timestamptodate function and when i am trying to use it it gives timestamp qoute,,can you pls help me wat to enter in that

Posted: Thu Jun 29, 2006 11:43 am
by us1aslam1us
Hi Thati,

Code: Select all

TimestampToTime(DSLink3.columnname)
That will do the job.

Sam

Posted: Thu Jun 29, 2006 11:54 am
by kumar_s
thatiprashant wrote:
ray.wurlod wrote:You do have it. Use the Expression Editor in a Transformer stage. It will appear in among the available Functions. ...
thanks for ur reply,,i found timestamptodate function and when i am trying to use it it gives timestamp qoute,,can you pls help me wat to enter in that
Sorry, could you be clear on what you need?

Posted: Thu Jun 29, 2006 3:28 pm
by ray.wurlod
The timestamp in quotes is a format string. You do not require this if your timestamp matches the default timestamp format for the job.

Posted: Fri Jun 30, 2006 4:30 am
by thatiprashant
us1aslam1us wrote:Hi Thati,

Code: Select all

TimestampToTime(DSLink3.columnname)
That will do the job.

Sam
thanks for the reply sam,, i did try that but it just gives the date as ******
and time rounded as 0 like 00:00:00

help on this wud be apreciated.

thanks

Posted: Fri Jun 30, 2006 6:44 am
by kumar_s
If your timestamp is with ' ', which is in string format, try using StringToTimestamp to convert to timestamp and later you can tyr using the mentioned function.

Posted: Fri Jun 30, 2006 7:10 am
by thatiprashant
kumar_s wrote:If your timestamp is with ' ', which is in string format, try using StringToTimestamp to convert to timestamp and later you can tyr using the mentioned function. ...
thanks for response,,my timestamp is in normal form with 18/12/1979 12:30:55

thanks

Posted: Fri Jun 30, 2006 9:11 am
by thatiprashant
ray.wurlod wrote:The timestamp in quotes is a format string. You do not require this if your timestamp matches the default timestamp format for the job. ...
thanks ray,,my time format matches for the job, but its still asking me to enter in quotes without that its not accepting

thanks