Page 1 of 1

Date to Timestamp conversion

Posted: Thu Nov 12, 2009 8:34 am
by pandujoy
Hi Gurus,

I have timestamp field coming from informix database (12/15/2008 10:11:12 AM) and when i am using the data type for the target as Timestamp i am getting "2008-12-15T16:11:12.000Z" Not sure why i am getting this junk values "T" and "Z"...can anyone help me out..

Thanks in advance

Posted: Thu Nov 12, 2009 8:43 am
by chulett
First off, those are not "junk" values. The 'T' marks the date/time boundary and the 'Z' means Zulu time, a UTC offset of "00.00" in an ISO 8601 timestamp. See here for the standards, especially pages 2 and 7. What is your target?

Posted: Thu Nov 12, 2009 9:11 am
by pandujoy
Thanks a lot for the information Chulett .

My input field is timestamp field - "12/15/2008 10:11:12 AM" and my target is timestamp .

Can you please tell me how to resolve this issue

Posted: Thu Nov 12, 2009 9:28 am
by chulett
No, what is your target - a flat file, database table, what? What happens if you declare it as a Varchar there?

Posted: Thu Nov 12, 2009 9:31 am
by pandujoy
my target is a webservice...Let me check what happens if i declare it as vchar thanks

Posted: Thu Nov 12, 2009 9:40 am
by chulett
OK, if your target is XML for a webservice the original format posted should work fine, I would think. Have you tried actually using it yet?

Posted: Thu Nov 12, 2009 9:57 am
by pandujoy
I didnt make any conversion and tried but i gave me the same result...

I tried "TimestamptoString(DSLink12.usg_begin_dt, "%yyyy-%mm-%dd %hh-%nn-%ss.5")" ...when i try to a flat file it worked but with in a service it didnt....

I am not sure how to solve this problem

Posted: Thu Nov 12, 2009 10:29 am
by pandujoy
Somebody plz help me in resolving this issue... :(

Posted: Thu Nov 12, 2009 11:01 am
by ArndW
The Zulu format for xml is a good one. What is your actual error when going to a service?

Posted: Thu Nov 12, 2009 11:04 am
by pandujoy
Not sure Arnd....

i am getting the result with in the service as "2008-12-15T06:00:00.000Z" I have defined the WISD output datatype as 25,5

Posted: Thu Nov 12, 2009 11:07 am
by ArndW
And is that an error? I am not sure what you want.

If you do

Code: Select all

TimestamptoString(DSLink12.usg_begin_dt, "%yyyy-%mm-%dd %hh-%nn-%ss.5")
what is your output?

Posted: Thu Nov 12, 2009 11:13 am
by chulett
So, no actual error - you've just never seen that before and thought there was something wrong with it? Are you trying to send that to the webservice or getting it back from the webservice? Assuming the latter, just strip the "zulu" part and replace the "T" with a space.

Posted: Thu Nov 12, 2009 12:56 pm
by pandujoy
can you tell me how to do...sorry my ignorance

Posted: Thu Nov 12, 2009 1:29 pm
by ArndW
Our problem is that we don't understand what your problem is.

Posted: Thu Nov 12, 2009 1:54 pm
by chulett
Can you answer my "Are you trying" question please?