Author |
Message
|
saurabh867 |
Posted: Wed Dec 14, 2011 10:46 pm Post subject: Get Current Date in different TimeZone |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Hi,
Is there any ESQL function available to give the current date in a given time zone as in JAVA?
I searched in InfoCenter but could not locate any such function.
Regards,
Saurabh |
|
Back to top |
|
 |
kash3338 |
Posted: Thu Dec 15, 2011 1:00 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
AFAIK there is no such inbuilt function available in ESQL. You should either add or sub from the GMT Timestamp. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 15, 2011 5:13 am Post subject: Re: Get Current Date in different TimeZone |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
saurabh867 wrote: |
Is there any ESQL function available to give the current date in a given time zone as in JAVA? |
Timestamps are either GMT or in the broker's locale because that's typically what you'd use; the GMT for messages passing round the back office, local time for something a user would see. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Dec 15, 2011 7:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You can always set up a java function to transform your timestamp from one timezone to the other...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
saurabh867 |
Posted: Thu Dec 15, 2011 9:01 pm Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Yes,
That is the last option but it comes with an overhead of having a static method only for getting current date.
Better I would write my own function to create date in the given time zone from the current time.
Thanks for your replies.
Regards,
Saurabh |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Dec 15, 2011 10:14 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
saurabh867 wrote: |
Yes,
That is the last option but it comes with an overhead of having a static method only for getting current date.
Better I would write my own function to create date in the given time zone from the current time.
Thanks for your replies.
Regards,
Saurabh |
You can do so in ESQL without much of a problem.
However you should be aware of the following
- In ESQL you would have to provide your own time zone offset for at least the target
- You should always provide the CURRENT_GMTTIMEZONE as input
- Don't know if the "feature" always giving the current offset to GMT when dealing with a (prior/future) date has been fixed in the current version...
This is why I thought that using Java which takes care of all of the above problems would not be a hardship there.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|