ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Converting Timestamp to a partiular format

Post new topic  Reply to topic
 Converting Timestamp to a partiular format « View previous topic :: View next topic » 
Author Message
wraymore
PostPosted: Wed Apr 16, 2008 9:31 am    Post subject: Converting Timestamp to a partiular format Reply with quote

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
View user's profile Send private message
Gemz
PostPosted: Wed Apr 16, 2008 10:27 am    Post subject: Reply with quote

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
View user's profile Send private message
mgk
PostPosted: Wed Apr 16, 2008 10:27 am    Post subject: Reply with quote

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
View user's profile Send private message
AkankshA
PostPosted: Wed Apr 16, 2008 8:12 pm    Post subject: Re: Converting Timestamp to a partiular format Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Converting Timestamp to a partiular format
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.