Author |
Message
|
kayhansefat |
Posted: Mon Aug 06, 2007 1:53 am Post subject: Cast Character to Time |
|
|
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 |
|
 |
AkankshA |
Posted: Mon Aug 06, 2007 3:06 am Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Mon Aug 06, 2007 3:14 am Post subject: |
|
|
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 |
|
 |
kayhansefat |
Posted: Mon Aug 06, 2007 3:15 am Post subject: |
|
|
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 |
|
 |
kayhansefat |
Posted: Mon Aug 06, 2007 3:20 am Post subject: |
|
|
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 |
|
 |
AkankshA |
Posted: Mon Aug 06, 2007 3:22 am Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Mon Aug 06, 2007 4:34 am Post subject: |
|
|
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 |
|
 |
kayhansefat |
Posted: Tue Aug 07, 2007 12:32 am Post subject: |
|
|
Acolyte
Joined: 18 Oct 2006 Posts: 65
|
Any ideas on this even though my timezone is set to Europe/London???? |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Aug 07, 2007 12:39 am Post subject: |
|
|
 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 |
|
 |
kayhansefat |
Posted: Tue Aug 07, 2007 1:20 am Post subject: |
|
|
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 |
|
 |
AkankshA |
Posted: Tue Aug 07, 2007 1:32 am Post subject: |
|
|
 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 |
|
 |
|