Author |
Message
|
pradha |
Posted: Sun Feb 10, 2008 10:03 pm Post subject: Timestamp issue |
|
|
Newbie
Joined: 10 Feb 2008 Posts: 7
|
How to get '12:00:00.000+05:30' in the output message when timestamp '2001-01-01'T'12:00:00+05:30' being input message. I get only 12:00:00 in the output message as MB fails to retrieve time zone along with time. Can anyone give me a solution for this issue. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 11, 2008 1:20 am Post subject: Re: Timestamp issue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pradha wrote: |
Can anyone give me a solution for this issue. |
If you told us what version of broker and posted the code giving the incorrect result then possibly yes.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pradha |
Posted: Mon Feb 11, 2008 1:34 am Post subject: Timestamp issue |
|
|
Newbie
Joined: 10 Feb 2008 Posts: 7
|
Thank u for having replied me.
Broker version 6
Code : SET messagedate = SUBSTRING(CAST(InputHdrRef.nsNGSubRed:Timestamp AS CHARACTER) FROM 12 FOR 10);
SET OutputHdrRef.MsgDate = CAST(messagedate AS DATE);
SET OutputHdrRef.MsgTime = SUBSTRING(CAST(InputHdrRef.nsNGSubRed:Timestamp AS CHARACTER) FROM 23 FOR 8 );
Input timestamp----2001-01-01'T'12:00:00+05:30
source data type is datetime (ie for field timestamp) format:-(yyyy-mm-dd'T'HH:mm:ssZZZ).
target data type is string (ie for msgtime) |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 11, 2008 1:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Why are you not maniputlating the timestamp directly, using EXTRACT or similar? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pradha |
Posted: Mon Feb 11, 2008 2:03 am Post subject: Timestamp issue |
|
|
Newbie
Joined: 10 Feb 2008 Posts: 7
|
It is the mapping field and also I have found that we can extract Time zone only from Local_Timezone. Do u have any solution for that. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 11, 2008 2:40 am Post subject: Re: Timestamp issue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pradha wrote: |
I have found that we can extract Time zone only from Local_Timezone. |
Really?
How have you arrived at this conclusion? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pradha |
Posted: Mon Feb 11, 2008 2:49 am Post subject: |
|
|
Newbie
Joined: 10 Feb 2008 Posts: 7
|
I found that extract function is used as following,
---------------------
EXTRACT(YEAR FROM CURRENT_DATE)
and
EXTRACT(HOUR FROM LOCAL_TIMEZONE)
both work without error, but
EXTRACT(DAY FROM CURRENT_TIME)
fails.
EXTRACT (DAYS FROM DATE '2000-02-29')
calculates the number of days encountered since year 1 to '2000-02-29' and
EXTRACT (DAYOFYEAR FROM CURRENT_DATE)
----------------------
Then tell me how to extract field values using EXTRACT function that too time zone in particular. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 11, 2008 3:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pradha wrote: |
EXTRACT(DAY FROM CURRENT_TIME)
fails.
|
DAY is a date function, not a time function.
pradha wrote: |
Then tell me how to extract field values using EXTRACT function that too time zone in particular |
EXTRACT parameters and their uses are documented in the ESQL reference. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|