Posted: Thu Oct 08, 2015 2:17 am Post subject: Regarding Date Format conversion
Acolyte
Joined: 19 Oct 2012 Posts: 63
Hi All,
As for my requirement i am receiving following dateformat :'dd/mm/yyyy hh:mm:ss' and i want to convert into the following format 'YYYY-MM-DDThh:mm:ss '
I have developed code as follows [DECLARE inpattern CHARACTER 'yyyy-MM-dd HH:mm:ss';
DECLARE outpattern CHARACTER 'YYYY-MM-DDThh:mm:ss';
DECLARE queryDate CHARACTER;
SET queryDate = CAST(OutputRoot.XMLNSC.Response.OutputData.DATA.Query.QueryDate AS TIMESTAMP FORMAT inpattern);SET OutputRoot.XMLNSC.namespace:GetInboxQueryListRes.namespace:ResBody.namespace:QueryDetails.namespace:Query.namespace:QueryDate = CAST(queryDate AS CHARACTER FORMAT outpattern);]
I am gelling below exceptions:
<EsbErrCode>3204</EsbErrCode>
<EsbErrLongDesc>28/05/2015 23:15:59.yyyy-MM-dd HH:mm:ss.28/05/2015 23:15:59.yyyy.Caught exception and rethrowing. Caught exception and rethrowing. Error detected, rethrowing. Error while casting. subParse failed.</EsbErrLongDesc>
<EsbErrShortDesc>RecoverableException</EsbErrShortDesc>
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
Code:
DECLARE inpattern CHARACTER 'yyyy-MM-dd HH:mm:ss';
DECLARE outpattern CHARACTER 'YYYY-MM-DDThh:mm:ss';
DECLARE queryDate CHARACTER;
SET queryDate = CAST(OutputRoot.XMLNSC.Response.OutputData.DATA.Query.QueryDate AS TIMESTAMP FORMAT inpattern);
SET OutputRoot.XMLNSC.namespace:GetInboxQueryListRes.namespace:ResBody.namespace:QueryDetails.namespace:Query.namespace:QueryDate = CAST(queryDate AS CHARACTER FORMAT outpattern);
How does this
28/05/2015 23:15:59
in anyway shape or form match the inpattern format? _________________ 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.
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