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 » Convert GMT to CST

Post new topic  Reply to topic
 Convert GMT to CST « View previous topic :: View next topic » 
Author Message
prakash27
PostPosted: Fri Aug 26, 2011 8:46 am    Post subject: Convert GMT to CST Reply with quote

Novice

Joined: 15 Feb 2011
Posts: 20

Just wondering how to convert a GMT Timestamp to CST timestamp considering daylight savings.

My Env: WMB61 AIX
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Aug 26, 2011 8:50 am    Post subject: Re: Convert GMT to CST Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

prakash27 wrote:
Just wondering how to convert a GMT Timestamp to CST timestamp considering daylight savings.


You could start with this.

Or better still, start with the search facility on the InfoCenter.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
prakash27
PostPosted: Fri Aug 26, 2011 9:04 am    Post subject: Convert GMT to CST Reply with quote

Novice

Joined: 15 Feb 2011
Posts: 20

Thanks Vitor for quick response.

INTERVAL command shouldn't work in my case since it doesn't take any parameters.

My scenario is: Application will send GMT timestamp like 2011-08-31T22:39:51Z. This needs to be converted to CST by WMB.

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Aug 26, 2011 9:11 am    Post subject: Re: Convert GMT to CST Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

prakash27 wrote:
INTERVAL command shouldn't work in my case since it doesn't take any parameters.


It shouldn't work in your case, and won't work in any one else's, because INTERVAL isn't a command.

prakash27 wrote:
My scenario is: Application will send GMT timestamp like 2011-08-31T22:39:51Z. This needs to be converted to CST by WMB.


Yes, I did understand that. And I stand by my previous post.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Aug 26, 2011 9:18 am    Post subject: Reply with quote

Jedi Knight

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

I disagree with your requirement to convert timestamp from GMT to CST. All computational times should only be represented as GMT, except when displayed to a user, through a user interface. Since WMB never displays time information to a user, there is no requirement to convert between timezones. (ie. WMB is not a user interface).
_________________
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
Vitor
PostPosted: Fri Aug 26, 2011 9:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lancelotlinc wrote:
All computational times should only be represented as GMT, except when displayed to a user, through a user interface.


I took the view that the local time was being so presented; the output from WMB being taken without further processing to a screen or print output.

Clearly just an assumption.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Aug 26, 2011 10:07 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

The OP hasn't said which CST he is talking about.
I seem to remember a previous question on this very topic.
http://www.worldtimezone.com/wtz-names/wtz-cst.html
Indicates that there are at least TWO places in the world that use CST as its Timezone.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Aug 26, 2011 10:08 am    Post subject: Reply with quote

Jedi Knight

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

http://www.w3.org/TR/timezone/

What is the purpose of a timestamp?
Quote:
If your application can accurately generate incremental and/or field-based times based on UTC and the events are not tied to specific local time, all that is needed is the timestamp value itself. That is, if your application never needs to recover what the actual wall time was when event occurred and only cares about relative ordering of events.


Why is the timezone not relevant in timestamps?
Quote:
In fact, it is often desirable to normalize time values to UTC (or a specific UTC offset) so that separate series of data can be easily compared and merged. Information about local offset may be valuable in recovering the actual wall time, but time zone rules are probably only rarely interesting.


W3C Best Practice:
Quote:
When creating content, use UTC for your time values whenever possible so that values from discrete sources can be compared more readily.

_________________
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
Vitor
PostPosted: Fri Aug 26, 2011 10:15 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

smdavies99 wrote:
Indicates that there are at least TWO places in the world that use CST as its Timezone.


Quite. I was sticking to the principle of timezone adjustment.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Aug 26, 2011 10:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lancelotlinc wrote:
http://www.w3.org/TR/timezone/

What is the purpose of a timestamp?
Quote:
If your application can accurately generate incremental and/or field-based times based on UTC and the events are not tied to specific local time, all that is needed is the timestamp value itself. That is, if your application never needs to recover what the actual wall time was when event occurred and only cares about relative ordering of events.


Quite true. And irrelevant to many humans, who want to look at broker output without further automated mediation.

lancelotlinc wrote:
Why is the timezone not relevant in timestamps?
Quote:
In fact, it is often desirable to normalize time values to UTC (or a specific UTC offset) so that separate series of data can be easily compared and merged. Information about local offset may be valuable in recovering the actual wall time, but time zone rules are probably only rarely interesting.


Still true, and as I attempted to indicate it's down to the individual (the OP in this instance) to determine the actual offset required (given which CST is meant). Comment above regarding humans repeated.

lancelotlinc wrote:
W3C Best Practice:
Quote:
When creating content, use UTC for your time values whenever possible so that values from discrete sources can be compared more readily.


The OP is not creating content, but interpreting it. The point of this thread is that someone has followed this practice and provided a timestamp in UTC. So your response is tautological at best.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Aug 26, 2011 10:23 am    Post subject: Reply with quote

Jedi Knight

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

Thank you for the complements, Sir Vitor, .... I think. I'm going to have to get my Merriam Webster 1847 dictionary out for 'tautological'.
_________________
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: Fri Aug 26, 2011 1:54 pm    Post subject: Reply with quote

Grand High Poobah

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

lancelotlinc wrote:
Thank you for the complements, Sir Vitor, .... I think. I'm going to have to get my Merriam Webster 1847 dictionary out for 'tautological'.

http://en.wikipedia.org/wiki/Tautology_%28rhetoric%29
is a quite good explanation...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Sun Aug 28, 2011 5:32 pm    Post subject: Re: Convert GMT to CST Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

prakash27 wrote:
Just wondering how to convert a GMT Timestamp to CST timestamp considering daylight savings.

Considering Daylight saving time, shouldn't that be CDT? The XSD dateTime type can only represent time zone offsets (like "Z" or "-05:00"), but not time zone identifiers (like "UTC" or "CDT"). Applications would need to keep track of the time zone IDs separately.

ESQL currently offers little support for specifying time zone offsets upon output; an external Java method may work better.

lancelotlinc wrote:
I disagree with your requirement ...

That seems a bit imperious.

lancelotlinc wrote:
All computational times should only be represented as GMT, except when displayed to a user, through a user interface. Since WMB never displays time information to a user, there is no requirement to convert between timezones. (ie. WMB is not a user interface).

Nonsense. The WMB transforms data for other applications, including user interfaces. Why shouldn't it transform time zones within timestamps for them, as well?

lancelotlinc wrote:
What is the purpose of a timestamp?
Quote:
If your application can accurately generate incremental and/or field-based times based on UTC and the events are not tied to specific local time, all that is needed is the timestamp value itself. That is, if your application never needs to recover what the actual wall time was when event occurred and only cares about relative ordering of events.

lancelotlinc wrote:
Why is the timezone not relevant in timestamps?
Quote:
In fact, it is often desirable to normalize time values to UTC (or a specific UTC offset) so that separate series of data can be easily compared and merged. Information about local offset may be valuable in recovering the actual wall time, but time zone rules are probably only rarely interesting.

These excerpts merely state that some applications only care about the order of events, so those applications don't need to convert timestamps to local time. But they don't address the OP's scenario; they don't even address the questions propped in front of them.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Aug 28, 2011 7:33 pm    Post subject: Re: Convert GMT to CST Reply with quote

Grand High Poobah

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

prakash27 wrote:
Just wondering how to convert a GMT Timestamp to CST timestamp considering daylight savings.

My Env: WMB61 AIX

I would suggest you use a Java function for this (relatively easy to do). Main reason is that AFAIK the broker will only use the current offset from GMT and not the offset at the time of the timestamp (implying differences due to DST).

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
prakash27
PostPosted: Mon Aug 29, 2011 10:23 am    Post subject: Convert GMT to CST Reply with quote

Novice

Joined: 15 Feb 2011
Posts: 20

Thank you all for your support and suggestions.
Below statement converted GMT timestamp to Local timestamp.
CAST(InputRoot.XMLNSC.GMTDate AS TIMESTAMP FORMAT 'IU')

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Convert GMT to CST
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.