Page 1 of 1

Timestamp to string in modify stage

Posted: Thu May 10, 2007 9:09 am
by reddy12
How can i change timestamp field into string and string to timestamp?
give me example on that.

specification property.

Thanks to all guys to sharing your ideas in DSXchange.

Posted: Thu May 10, 2007 10:16 am
by diamondabhi
search the forum, here are some samples:

string_from_timestamp (timestamp, string)
timestamp_from_string (string, timestamp)
timestamp_from_ustring (ustring, timestamp)
ustring_from_timestamp (timestamp, ustring)

Posted: Thu May 10, 2007 11:02 am
by DSguru2B
Same thing can also be done in a px transformer. StringToTimestamp() and TimestampToString() functions, I believe, in the transformer. You can find the complete list under Transforms, under Type Conversion when you right click on the extended derivation window.

Posted: Thu May 10, 2007 5:14 pm
by ray.wurlod
In the Modify stage the format string is given in square brackets, the input argument (field name) is given in parentheses. For example

Code: Select all

string_from_timestamp[%yyyy-%mm-%dd %hh:%nn:%ss](MyTimestamp)
Note that minutes are specified as %nn, not %mm.

Posted: Thu May 10, 2007 6:07 pm
by reddy12
I am not able to see the code
can you please type only the code?
ray.wurlod wrote:In the Modify stage the format string is given in square brackets, the input argument (field name) is given in parentheses. For example

Code: Select all

string_from_timestamp[%yyyy-%mm-%dd %hh:%nn: ...[/quote]

Posted: Thu May 10, 2007 6:14 pm
by us1aslam1us
A clear specification with format is given in Parallel Job Developer's guide, Page 28-10,28-11.

Posted: Thu May 10, 2007 6:26 pm
by reddy12
here i am littile bit confusion wtih (timestamp)
string_from_timestamp[timestamp_format] (timestamp)

string_from_timestamp[%yyyy-%mm-%dd %hh:%nn:%ss](DATEFIELD)
Is this above code correct?
us1aslam1us wrote:A clear specification with format is given in Parallel Job Developer's guide, Page 28-10,28-11.

Posted: Thu May 10, 2007 6:31 pm
by us1aslam1us
Yes Perfect!!