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 » Datetime conversion

Post new topic  Reply to topic
 Datetime conversion « View previous topic :: View next topic » 
Author Message
RB
PostPosted: Wed May 09, 2007 9:03 am    Post subject: Datetime conversion Reply with quote

Acolyte

Joined: 23 May 2006
Posts: 56

Hi All,

I am trying the following code to cast the datetime.

Code:
CAST( '2001-10-10T11:12:13-05:00' AS TIMESTAMP FORMAT 'yyyy-MM-ddTHH:mm:ssZZZ')


But this gives me the follwing error.

RecoverableException BIP3204S: Input expression ''2001-10-10T11:12:13-05:00'' does not match FORMAT expression ''yyyy-MM-ddTHH:mm:ssZZZ''. Parsing failed to match ''T11:12:13-05:00'' with ''T''.
The given expression contains data which does not match the current element of the FORMAT expression

Can anyone please let me know what I am doing wrong here? I am using MB6 on Linux.

Regards,
RB
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Wed May 09, 2007 11:05 am    Post subject: Re: Datetime conversion Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Is it TIMESTAMP ?

TIMESTAMP example is 2006-02-01 13:13:56.444730

I haven't test but can you try with :

Code:
CAST( '2001-10-10 11:12:13' AS TIMESTAMP FORMAT 'yyyy-MM-ddTHH:mm:ssZZZ')

_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
RB
PostPosted: Wed May 09, 2007 11:27 am    Post subject: Reply with quote

Acolyte

Joined: 23 May 2006
Posts: 56

Thanks for your reply.

Yes it is timestamp. But I am getting this in this format from the input message with a T in between. I am extracting the timestamp from one of the input fields.

I think I am not using the right patter for casting. If I am try the following, it works fine.

Code:
CAST( '2001-10-10 11:12:13-03:00' AS TIMESTAMP FORMAT 'yyyy-MM-dd HH:mm:ssZZZ');


How can I specify 'T' in the pattern? Am I doing it wrong?

Regards,
RB
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed May 09, 2007 11:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Try using a pattern of 'I'.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RB
PostPosted: Wed May 09, 2007 11:53 am    Post subject: Reply with quote

Acolyte

Joined: 23 May 2006
Posts: 56

Thanks jefflowrey. It worked with 'I' pattern.

Regards,
Rijesh
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 09, 2007 2:53 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

RB wrote:
Thanks for your reply.

Yes it is timestamp. But I am getting this in this format from the input message with a T in between. I am extracting the timestamp from one of the input fields.

I think I am not using the right patter for casting. If I am try the following, it works fine.

Code:
CAST( '2001-10-10 11:12:13-03:00' AS TIMESTAMP FORMAT 'yyyy-MM-dd HH:mm:ssZZZ');


How can I specify 'T' in the pattern? Am I doing it wrong?

Regards,

RB

I'd check to make sure I got the difference between dd and DD right.

One expects the date in julian format (days in the year) the other looks for days in the month...

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RB
PostPosted: Fri May 11, 2007 8:45 am    Post subject: Reply with quote

Acolyte

Joined: 23 May 2006
Posts: 56

Here is the ref to the format patterns.
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05616_.htm
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri May 11, 2007 1:22 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Have you tried:

Code:
CAST( '2001-10-10 11:12:13-03:00' AS TIMESTAMP FORMAT 'yyyy-MM-dd''T''HH:mm:ssZZZ');

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Datetime conversion
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.