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 » casting CHARACTER as TIMESTAMP doesnt't preserve timezone

Post new topic  Reply to topic
 casting CHARACTER as TIMESTAMP doesnt't preserve timezone « View previous topic :: View next topic » 
Author Message
cynik
PostPosted: Wed Jun 01, 2011 1:24 am    Post subject: casting CHARACTER as TIMESTAMP doesnt't preserve timezone Reply with quote

Newbie

Joined: 31 Mar 2009
Posts: 9

Could someone please help me with following problem?

Setup:
Operating system: Microsoft Windows Server 2003, Standard Edition, SP2
OS timezone is set to: UTC+01:00 (Belegrade, Bratislava, Budapest,...)
Websphere MQ: 7.0.1.2
Websphere Message Broker: 7.0.0.2


Problem Description:
DST transition in OS specified timezone is from 2011-10-30T03:00:00+02:00 to 2011-10-30T02:00:00+01:00. Casting CHARACTER (containing time from this transition period) as a TIMESTAMP doesn’t preserve specified timezone.

ESQL example:
DECLARE inputDatetime CHARACTER '2011-10-30T02:30:00+02:00';
DECLARE datetime TIMESTAMP CAST(inputDatetime AS TIMESTAMP FORMAT 'I');
DECLARE outputDatetime CHARACTER CAST(datetime AS CHARACTER FORMAT 'I');

Resulting outputDatetime contains '2011-10-30T02:30:00+01:00' instead of expected '2011-10-30T02:30:00+02:00'
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jun 01, 2011 4:23 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You should not be using a TZ offset in stored time values anyway. If you store or manipulate time values, do so in GMT. Convert only to local time when and if displayed to a human. Any other use of time value should only be in GMT and therefore no TZ offset is needed to be stored with that value.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Jun 01, 2011 12:52 pm    Post subject: Reply with quote

Grand High Poobah

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

Time and time again I am amazed by what is assumed and taken as matter of fact when dealing with timestamps, date and time values.

Here is my short list of answers
  1. If you need to look at time intervals and date and time values across time zones, use only a GMT notation. Your time will always be exact.
  2. The broker's time system with DST used to have a flaw in that that it did only take into account the offset at time of processing (now) and not at time of date (future or past). Although time handling has been made much better I have not verified yet if this has been fixed.
  3. This is a reason to use java only (with the latest TZ fixpack) when converting from one TZ to the other using a text format, or a long.
    Intervals should only be displayed in GMT format.


Finally @ cynik USE GMTTIMESTAMP and do not use TIMESTAMP.

Enjoy one and all.
_________________
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 » casting CHARACTER as TIMESTAMP doesnt't preserve timezone
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.