ISO Date Format Conversion

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
subramanya
Participant
Posts: 22
Joined: Fri Oct 15, 2004 11:53 pm
Location: Bangalore, India
Contact:

ISO Date Format Conversion

Post by subramanya »

Hi,

Is there any function to convert the current DateTimestamp into the following ISO date format: 2009-07-29T11:20:32.0Z

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

Post by ray.wurlod »

Which ISO standard specifies that format? What is "0Z"?

ISO 8601 (date and time formats) specifies YYYY-MM-DD HH:MM:SS with optional fractional seconds for a timestamp).

Conversion is only relevant if the target is a string data type.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Apparently that's a Java implementation of an "ISO 8601" format and I keep seeing search results calling it a SimpleDateFormat. For example, go here and scroll down to Method Detail and the isoFormat entry. The 'Z' seems to be a timezone offset.
-craig

"You can never have too many knives" -- Logan Nine Fingers
subramanya
Participant
Posts: 22
Joined: Fri Oct 15, 2004 11:53 pm
Location: Bangalore, India
Contact:

Post by subramanya »

Thanks for the reply
ray.wurlod wrote:Which ISO standard specifies that format?
Not sure. My guess is that this is an extended format for ISO 8601.
ray.wurlod wrote:What is "0Z"?
'Z' is the zone designator for the zero UTC (Coordinated Universal Time) offset.
--------------
Subramanya
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

OK, you're probably going to need a fairly complex expression to effect the conversion from local time to UTC if the solution needs to be general, or use a constant offset for a limited result. (Incidentally, how is Indian Standard Time (4.5 hours offset) represented?)

The rest should just be decomposing the string, adjusting the hour (and, possibly, the day), then re-assembling the string. Should be able to do it all in stage variables.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
anu123
Premium Member
Premium Member
Posts: 143
Joined: Sun Feb 05, 2006 1:05 pm
Location: Columbus, OH, USA

Post by anu123 »

subramanya

Did you find a solution? We have a requirement to convert UTC datatime into EST and load into a DB2 table.

It would great if you can share the solution.

Thanks in advance.
Thank you,
Anu
Post Reply