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 » How to convert timestamp format

Post new topic  Reply to topic
 How to convert timestamp format « View previous topic :: View next topic » 
Author Message
N
PostPosted: Wed Oct 17, 2007 10:14 pm    Post subject: How to convert timestamp format Reply with quote

Acolyte

Joined: 21 Jul 2007
Posts: 64

Hi,

How to convert current timestamp to yyyymmddhhmmssmm.

Please help.Thanks.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Oct 17, 2007 10:33 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi N,

What have you tried as of now ?

Did you try declaring a variable with the 'FORMAT' clause ?


Regards.
Back to top
View user's profile Send private message Send e-mail
N
PostPosted: Wed Oct 17, 2007 10:39 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Jul 2007
Posts: 64

Hi,

Currently i use
SET OutputRoot.MRM.DATE = CURRENT_TIMESTAMP
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Thu Oct 18, 2007 4:51 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

From online help:
Quote:
Example 2. Formatted CAST from DATE to CHARACTER
DECLARE now CHARACTER = CAST(CURRENT_TIMESTAMP AS CHARACTER
FORMAT 'yyyyMMdd-HHmmss');
-- target is now '20041007-111656' (in this instance at least)

Also see:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak05616_.htm
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
N
PostPosted: Thu Oct 18, 2007 10:46 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Jul 2007
Posts: 64

Hi,


Thanks for your reply. Following code is working for V6 only. Im using V5.

DECLARE CurrentTimeStamp TIMESTAMP;
SET CurrentTimeStamp = TIMESTAMP 'yyyy-MM-dd-HH';

Back to top
View user's profile Send private message
N
PostPosted: Thu Oct 18, 2007 11:50 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Jul 2007
Posts: 64

Hi,

DECLARE target CHARACTER;
SET target = CAST(CURRENT_TIMESTAMP AS TIMESTAMP FORMAT 'yyyyMMddHH');

This also fail. It return whole junk of timestamp....
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Fri Oct 19, 2007 5:05 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

FORMAT in CAST is not supported in V5.
You will have to write your own function to do what you want in V5.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to convert timestamp format
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.