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 » Cast Character to Time

Post new topic  Reply to topic
 Cast Character to Time « View previous topic :: View next topic » 
Author Message
kayhansefat
PostPosted: Mon Aug 06, 2007 1:53 am    Post subject: Cast Character to Time Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

I have the following:

DECLARE time1 CHARACTER;
DECLARE time2 TIME;

SET time1 = '13:43:00';
time2 = CAST(time1 AS TIME FORMAT 'HH:mm:ss');

How come time2 now is 14:43:00.000 ????

In the help docs it does state:

"24-hour fields might result in an ambiguous time, if specified with a conflicting am/pm field."
Back to top
View user's profile Send private message
AkankshA
PostPosted: Mon Aug 06, 2007 3:06 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

i tried this in my environment and it gives me time2 as 13:43:00.000

i am on windows XP
MB 6.0.0.0

which env u working on???
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Mon Aug 06, 2007 3:14 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

AkanshA, you should apply FP3 to that 6.0.0.0....

kayhansefat - sounds like your timezone is not set to what you think it is.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kayhansefat
PostPosted: Mon Aug 06, 2007 3:15 am    Post subject: Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

Linux AS v3
Broker 6.0.0.4

Tried it again in a new project and still applies as I described!
Back to top
View user's profile Send private message
kayhansefat
PostPosted: Mon Aug 06, 2007 3:20 am    Post subject: Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

jefflowrey - Thanks for your post, I have checked the timezone in Linux system settings and it is set to 'Europe/London'.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Mon Aug 06, 2007 3:22 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

hey jeff i myself wasn't aware that my desktop is not upgraded realised it when i typed on forum in reply

jumping to fix pack 4 now
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Mon Aug 06, 2007 4:34 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

AkankshA wrote:
hey jeff i myself wasn't aware that my desktop is not upgraded realised it when i typed on forum in reply

jumping to fix pack 4 now


FP4 is withdrawn...

FP3 for now or wait for FP5.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kayhansefat
PostPosted: Tue Aug 07, 2007 12:32 am    Post subject: Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

Any ideas on this even though my timezone is set to Europe/London????
Back to top
View user's profile Send private message
AkankshA
PostPosted: Tue Aug 07, 2007 12:39 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

since ur timezone is set to london it mite be doing day light saving for you...

change the timezone of ur system to GMT and it shall give you same value
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
kayhansefat
PostPosted: Tue Aug 07, 2007 1:20 am    Post subject: Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

Well running the 'date' command confirms:

Tue Aug 7 09:41:37 BST 2007

British Summer Time - which is correct as it is. I guess then that the CAST function presumes that time1 is in GMT and hence adds 1 to it. Is there a way to specify the current time zone of the server in the CAST function?

AkankshA - Thanks, but I dont really want to change the timezone to GMT as the timezone will get changed automatically when we hit our Winter Time.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Tue Aug 07, 2007 1:32 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

you can specify gmttime in your cast statement

not sure of any direct conversion method.... but broker gives u local time as well as gmttime and using them u shall achive the conversion... no doubt it involves eSQL skills
_________________
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 » Cast Character to Time
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.