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 IndexWebSphere Message Broker SupportTimezone in ESQL

Post new topicReply to topic
Timezone in ESQL View previous topic :: View next topic
Author Message
soudhanya
PostPosted: Thu Jul 27, 2017 10:03 am Post subject: Timezone in ESQL Reply with quote

Newbie

Joined: 27 Feb 2017
Posts: 8

How to set timezone in ESQL like below java code?

Code:
if(n.getAttributes().getNamedItem("IntervalZone").getNodeValue().equals("MountainUS")){
                     inSDF.setTimeZone(TimeZone.getTimeZone("US/Mountain"));
                     outSDF.setTimeZone(TimeZone.getTimeZone("US/Mountain"));
                     timeZone="MT";                     
                  }
                  //else if(n.getAttributes().getNamedItem("IntervalZone").getNodeValue().equals("MountainUSStandard")){
                  else if(n.getAttributes().getNamedItem("IntervalZone").getNodeValue().equals("MountainUSNoDst")){   
                     inSDF.setTimeZone(TimeZone.getTimeZone("GMT-7:00"));
                     outSDF.setTimeZone(TimeZone.getTimeZone("GMT-7:00"));
                     timeZone="MST";
                  }
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Thu Jul 27, 2017 10:33 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24391
Location: Ohio, USA

You don't - ESQL doesn't work that way.

I'm surprised you need to do that in Java, but then I'm often surprised about Java.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 27, 2017 8:56 pm Post subject: Re: Timezone in ESQL Reply with quote

Grand Poobah

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

soudhanya wrote:
How to set timezone in ESQL like below java code?

Code:
if(n.getAttributes().getNamedItem("IntervalZone").getNodeValue().equals("MountainUS")){
                     inSDF.setTimeZone(TimeZone.getTimeZone("US/Mountain"));
                     outSDF.setTimeZone(TimeZone.getTimeZone("US/Mountain"));
                     timeZone="MT";                     
                  }
                  //else if(n.getAttributes().getNamedItem("IntervalZone").getNodeValue().equals("MountainUSStandard")){
                  else if(n.getAttributes().getNamedItem("IntervalZone").getNodeValue().equals("MountainUSNoDst")){   
                     inSDF.setTimeZone(TimeZone.getTimeZone("GMT-7:00"));
                     outSDF.setTimeZone(TimeZone.getTimeZone("GMT-7:00"));
                     timeZone="MST";
                  }


Sorry but I have to question if you're doing the right thing here.
The interval is an absolute value difference between 2 time moments.
Looking at Java it should always be expressed in GMT as the effective value for the timestamp (long) is always represented in GMT.

Now displaying a moment + an interval, you may want to display the resulting moment in the same time zone as the originating moment....

But be assured that we are talking about display here and that should be a function of the application. As far as the ESB and the storage / messaging of the data, all time data should be recorded in GMT.
Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Fri Jul 28, 2017 3:15 am Post subject: Reply with quote

Yatiri

Joined: 25 Aug 2015
Posts: 643

Quote:
As far as the ESB and the storage / messaging of the data, all time data should be recorded in GMT.
I agree. I suggest that you review the requirements and ask why this is being requested.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 28, 2017 5:03 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24391
Location: Ohio, USA

timber wrote:
Quote:
As far as the ESB and the storage / messaging of the data, all time data should be recorded in GMT.
I agree. I suggest that you review the requirements and ask why this is being requested.


Oh good - I was wondering what the heck was going on here and assumed it was some kind of weird Java thing.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportTimezone in ESQL
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.