Author |
Message
|
kumar_eee07 |
Posted: Wed Sep 15, 2010 5:48 am Post subject: milliseconds to timestamp |
|
|
Newbie
Joined: 14 Jun 2010 Posts: 5
|
how to convert milliseconds to timestamp in esql in mb .please help .it is very urgent
input format:196928775582 (value in milli seconds)
output format : YYYY-MM-DDThh:mm:ss.SSS |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 15, 2010 5:56 am Post subject: Re: milliseconds to timestamp |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kumar_eee07 wrote: |
how to convert milliseconds to timestamp in esql in mb |
What have you already tried? There's no point us suggesting code that's already not worked for you.
The obvious method is divide by 1000 to obtain seconds, then use the ESQL to convert that (AFAIK you can't go directly to that ISO timestamp format but I'll be corrected on that). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Sep 15, 2010 6:49 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
To give you some hints, you need to realize that MQ message timestamps are not measured in millis. There are also two parts to an MQ message timestamp: Date and Time. These two values are oriented to Zulu time. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Last edited by lancelotlinc on Thu Sep 16, 2010 5:21 am; edited 1 time in total |
|
Back to top |
|
 |
francoisvdm |
Posted: Wed Sep 15, 2010 9:32 pm Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
Gosh lancelotlinc, tone down your tone please! Clearly Kumar is a newbie here! And what on earth makes you think his question has to do with MQ messages time and date stamps. If you can't or won't help, please refrain from making negative statements like yours....just move on and add some real value somewhere else. If you want to demonstrate your superior knowledge the give an answer, not a snotty remark that wastes everybody else's time. _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
SANTYP |
Posted: Thu Sep 16, 2010 1:17 am Post subject: |
|
|
 Centurion
Joined: 27 Mar 2007 Posts: 142
|
i think u can try with below format
yyyy-MM-dd'T'HHmmssZZZ |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Sep 16, 2010 6:20 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
francoisvdm |
Posted: Thu Sep 16, 2010 11:14 pm Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
Thanks Sir Lancelot
This is such a fantastic forum and the newbies are feeding the site... And on that course, I often give that course in the classroom situation, I can recommend it. In fact, I gave that course (the classroom version) last week to 8 students in Cape Town.
Regards _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
Luke |
Posted: Thu Sep 16, 2010 11:54 pm Post subject: |
|
|
Centurion
Joined: 10 Nov 2008 Posts: 128 Location: UK
|
kumar_eee07 wrote: |
how to convert milliseconds to timestamp in esql in mb .please help .it is very urgent
input format:196928775582 (value in milli seconds)
output format : YYYY-MM-DDThh:mm:ss.SSS |
Hi
Going back to the original question, I don't have direct experience with a date in this format, but is it one of those things where it represents the number of miliseconds since Jan 1st 1970?
If it's something like that, then I guess you can divide the miliseconds by 1000 (as per Vitor's post), and CAST that to an interval. Declare a Timestamp for Jan 1st 1970 (or whenever), and add the interval. You can then CAST the timestamp to whatever output format you require (as per SANTYP's post)
Or maybe you've already found a better way, or maybe I've misunderstood the question? |
|
Back to top |
|
 |
|