|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Converting Timestamp to a partiular format |
« View previous topic :: View next topic » |
Author |
Message
|
wraymore |
Posted: Wed Apr 16, 2008 9:31 am Post subject: Converting Timestamp to a partiular format |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
Have a timestamp in message that may not be in the format required for entry into database. Need to check the input timestamp for the required format, if not the required format, then convert.
ex:
required format:
2008-04-15T09:56:53Z
input format:
2008-04-16T10:30:20-04:00 |
|
Back to top |
|
 |
Gemz |
Posted: Wed Apr 16, 2008 10:27 am Post subject: |
|
|
 Centurion
Joined: 14 Jan 2008 Posts: 124
|
One way is to Substring 2008-04-16T10:30:20-04:00 as 2008-04-16 and 10:30:20 and then concatenate those.
Regards
Gemz |
|
Back to top |
|
 |
mgk |
Posted: Wed Apr 16, 2008 10:27 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Look up the FORMAT clause of the CAST statement in the docs if you are using 6.0 or greater. Otherwise you will have to do this manually... _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Apr 16, 2008 8:12 pm Post subject: Re: Converting Timestamp to a partiular format |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
wraymore wrote: |
Have a timestamp in message that may not be in the format required for entry into database. Need to check the input timestamp for the required format, if not the required format, then convert.
ex:
required format:
2008-04-15T09:56:53Z
input format:
2008-04-16T10:30:20-04:00 |
i hope you want to take into account the + / - operators as well
if yes.. then u have to do a lil bit eSQL here
2008-04-16T10:30:20-04:00
if need to be converted to your required format , ll have 4 hours deduction... as specified by - sign..
i guess you are dealing with different timezones specifying time in GMT..
the way to go for you would involve usage of substring, interval and concatenation operator
 _________________ Cheers |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|