|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Help obtaining local time with INTERVAL value substitution |
« View previous topic :: View next topic » |
Author |
Message
|
smeunier |
Posted: Fri Mar 26, 2010 6:41 am Post subject: Help obtaining local time with INTERVAL value substitution |
|
|
 Partisan
Joined: 19 Aug 2002 Posts: 305 Location: Green Mountains of Vermont
|
I'm trying to do what would seem like a simple task, but keep hitting a wall. With the following statement:
Code: |
CAST((InputRoot.MQMD.PutTime-INTERVAL '4' HOUR) AS CHARACTER FORMAT 'HH:mm:ss') |
I would like to substitue the value '4' with what is returned by the LOCAL_TIMEZONE. In my case the LOCAL_TIMEZONE retuns an interval of -240 minutes. All the numbers works out, but try as I might I can't get this to work unless I use a hard value of '4'
Using:
Code: |
CAST((InputRoot.MQMD.PutTime-LOCAL_TIMEZONE) AS CHARACTER FORMAT 'HH:mm:ss') |
as it moves the time ahead by about 8 hrs
Any ideas? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Mar 26, 2010 7:04 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Hi smeunier,
Apparently from what I read, there is some funky stuff that happens with CAST and Timezone. Check these links:
"Resolving ESQL problems when developing message flows
The CAST function does not provide the expected DST offset for non-GMT time zones"
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/au16532_.htm
"Understanding daylight saving time and the CAST function"
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05616_.htm
When the broker is running in a time zone other than GMT, it calculates the daylight saving time (DST) offset on times that are supplied to it by the CAST function. For CAST to calculate the offset correctly, the time passed into CAST must have a time zone associated with it, as a Z parameter. If no time zone is associated with the value passed, the time is converted into GMT time; it is not treated as a local time stamp.
Sounds like a work around is needed. One thing I thought about is get to the right value first, then manually construct the string to display to the human. If putting this time in a storage location, such as a log or a database field, I would not convert it to local time, I would leave it as GMT.
Sincerely,
Sirlancelotlinc
Rorqual qualified
P. S.
I'm not an ex-pert, just a pert. Someone else may have a better handle on it. As when a lion looks at more than three points (ie. a lion tamer's chair has four points), I get confused when thinking about localized time and date issues. Would rather just use Zulu time. Best of luck to you. |
|
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
|
|
|
|