Author |
Message
|
Chewbacca |
Posted: Wed Dec 11, 2013 7:37 am Post subject: transform arbitrarily timestamp of type dateTime |
|
|
 Newbie
Joined: 22 Jul 2009 Posts: 1
|
Hi there!
Is there a simple way of transforming an arbitrarily timestamp of type dateTime into an MEZ timestamp of type dateTime
On InputRoot everything is allowed which is confirm with type=dateTime, every timezone is possible
e.g.
2013-06-14T12:50:50.352+1:00
2013-06-14T12:50:50+1:00
2013-06-14T12:50:50.352+2:00
2013-06-14T12:50:50.352-09:00
2013-06-14T12:50:50.352+05:00
On OutputRoot I need to transform it on the MEZ timezone => 2013-06-14T12:50:50.352+1:00
Any suggestion would be helpfull.
Thanks. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Dec 11, 2013 1:40 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Ah, you mean CET. Most people here wouldn't understand that MEZ is the german representation of CET (UTC+1 or UTC+2)
You could think about converting the incoming time to GMT/UTC and then adding the LOCAL_TIMEZONE to that value. _________________ 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 |
|
 |
fjb_saper |
Posted: Thu Dec 12, 2013 10:58 am Post subject: Re: transform arbitrarily timestamp of type dateTime |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Chewbacca wrote: |
Hi there!
Is there a simple way of transforming an arbitrarily timestamp of type dateTime into an MEZ timestamp of type dateTime
On InputRoot everything is allowed which is confirm with type=dateTime, every timezone is possible
e.g.
2013-06-14T12:50:50.352+1:00
2013-06-14T12:50:50+1:00
2013-06-14T12:50:50.352+2:00
2013-06-14T12:50:50.352-09:00
2013-06-14T12:50:50.352+05:00
On OutputRoot I need to transform it on the MEZ timezone => 2013-06-14T12:50:50.352+1:00
Any suggestion would be helpfull.
Thanks. |
I don't understand your requirement.
The Timestamp is correct. Changing the time and offset to still match is a cosmetic requirement and should be handled by the front end. I usually use java for this. Mind you, if you use the broker the java DateFormat class is not threadsafe... (Use threadlocal)
Timestamps on the broker should be only handled in GMT. _________________ MQ & Broker admin |
|
Back to top |
|
 |
msiegert |
Posted: Wed Dec 18, 2013 4:18 am Post subject: |
|
|
 Apprentice
Joined: 05 Aug 2001 Posts: 29
|
Hi!
Thanks for your replies.
My requirement is that I need to calculate/transform/convert ...
an incoming dateTime
e.g.
2013-12-10T07:54:55.033-06:00
to an outgoing dateTime
2013-12-10T14:54:55.033+01:00
What is the best function to do that |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Dec 18, 2013 5:04 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
did you try what I suggested a week ago? _________________ 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 |
|
 |
msiegert |
Posted: Wed Dec 18, 2013 6:15 am Post subject: |
|
|
 Apprentice
Joined: 05 Aug 2001 Posts: 29
|
yes, but now I'm getting an error:
<Insert Type="5" Text="'2013-12-10T23:54:55.033+01:00'"></Insert><Insert Type="5" Text="GMTTIMESTAMP"></Insert><RecoverableException File="F:\build\S700_P\src\CommonServices\ImbTimeStampFormatter.cpp" Line="1954" Function="ImbTimeStampFormatter::parseData" Type="" Name="" Label="" Catalog="BIPmsgs" Severity="3" Number="3204" Text="Literal failed to match"><Insert Type="5" Text="2013-12-10T23:54:55.033+01:00"></Insert><Insert Type="5" Text="yyyy-MM-dd"T"HH:mm:ss.SSSZZZ">
while casting: SET (OutputRoot....date = CAST(OutputRoot....date AS GMTTIMESTAMP FORMAT 'yyyy-MM-dd"T"HH:mm:ss.SSSZZZ') |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Dec 18, 2013 6:20 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Please don't post the same question in multiple threads.
I have answered you in the other thread but please continue the problem here. _________________ 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 |
|
 |
msiegert |
Posted: Wed Dec 18, 2013 7:19 am Post subject: |
|
|
 Apprentice
Joined: 05 Aug 2001 Posts: 29
|
thanks, the 'IU' advice helped.
The code:
SET OutputRoot...date =
CAST(OutputRoot...date AS GMTTIMESTAMP FORMAT 'IU') + LOCAL_TIMEZONE;
does what it should, finally pretty simple.
For any reason I've two profiles here, I guess I should delete one. |
|
Back to top |
|
 |
LearningMB |
Posted: Tue Jan 21, 2014 4:48 am Post subject: |
|
|
Newbie
Joined: 21 Jan 2014 Posts: 9
|
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 21, 2014 6:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
LearningMB wrote: |
What is IU here? |
The format code. It's documented in the InfoCenter. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|