ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Setting the CreationDateandTime tag HELP!!!!!

Post new topic  Reply to topic
 Setting the CreationDateandTime tag HELP!!!!! « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Tue Mar 04, 2003 7:10 am    Post subject: Setting the CreationDateandTime tag HELP!!!!! Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

I need to set the CreationDateandTime tag according to the following format:

<CreationDateTime>2001-12-17T09:30:47</CreationDateTime>

Can someone please help me with how to code this tag?

Thanks!! LisaB
Back to top
View user's profile Send private message
yaakovd
PostPosted: Tue Mar 04, 2003 11:48 am    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

Lisa,
Code:
SET "OutputRoot"."XML"."YourPath"."CreationDateTime" =
CAST(EXTRACT(YEAR FROM  CURRENT_DATE) AS CHARACTER) || '-' ||
                SUBSTRING((CAST(100 + EXTRACT(MONTH FROM  CURRENT_DATE)AS CHARACTER)) FROM 2 FOR 3) || '-' ||
                SUBSTRING((CAST(100 + EXTRACT(DAY FROM  CURRENT_DATE)AS CHARACTER)) FROM 2 FOR 3)  || 'T' ||
      SUBSTRING((CAST(100 + EXTRACT(HOUR FROM  CURRENT_TIME) AS CHARACTER)) FROM 2 FOR 3) ||  ':' ||
                SUBSTRING((CAST(100 + EXTRACT(MINUTE FROM  CURRENT_TIME) AS CHARACTER)) FROM 2 FOR 3)|| ':' ||
                SUBSTRING((CAST(100 + CAST(EXTRACT(SECOND FROM  CURRENT_TIME)*6/10 AS INT) AS CHARACTER)) FROM 2 FOR 3);

_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
LH33
PostPosted: Tue Mar 04, 2003 11:51 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Thank you very much!!!! I really appreciate it!!
Back to top
View user's profile Send private message
yaakovd
PostPosted: Tue Mar 04, 2003 11:59 am    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel


Special point on seconds generation.
In MQSI 2.0.2 EXTRACT(SECOND FROM CURRENT_TIME is not return seconds (this is the reason of coefficient 6/10).
I still not tested it in MQSI 2.1.

I leave it for you
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
Chuck831
PostPosted: Wed Jun 11, 2003 5:56 am    Post subject: Formatting Date and Time Reply with quote

Apprentice

Joined: 23 Dec 2002
Posts: 28

Here is an easier way to do it:
Code:

   Delare NewDate CHAR;
   Declare WorkDate CHAR;
   SET NewDate = CURRENT_TIMESTAMP;
   SET WorkDate = SUBSTRING(NewDate FROM 12 FOR 23);
   SET OutputRoot.XML.Table.WORKDATE = OVERLAY(WorkDate PLACING 'T' FROM 11 FOR 1);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Setting the CreationDateandTime tag HELP!!!!!
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.