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 » Getting current system date and time

Post new topic  Reply to topic
 Getting current system date and time « View previous topic :: View next topic » 
Author Message
j1
PostPosted: Sat Aug 02, 2003 2:11 pm    Post subject: Getting current system date and time Reply with quote

Centurion

Joined: 23 Jun 2003
Posts: 139

Hi,

I need to put in the currend system date and time in the format YYYY-MM-DD-hh.mm.ss.nnnn into an XML field. when i try to do a substring of CURRENT_TIME, i get odd output like TIMESTAMP '2003-08-02 .

Could someone please supply the line of code that will get me the date in the above format.

Thanks,
Sailesh
Back to top
View user's profile Send private message
EddieA
PostPosted: Sat Aug 02, 2003 3:58 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Take the value you've got back ands SUBSTRING parts of it to get the format you want.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
j1
PostPosted: Sun Aug 03, 2003 10:28 am    Post subject: Reply with quote

Centurion

Joined: 23 Jun 2003
Posts: 139

I already tried that but the &apos refuses to go away...
Back to top
View user's profile Send private message
j1
PostPosted: Sun Aug 03, 2003 10:55 am    Post subject: Reply with quote

Centurion

Joined: 23 Jun 2003
Posts: 139

For Example, when i try to do the following :

SET TimeString = CURRENT_TIMESTAMP;
SET TimeString1 = (SUBSTRING (TimeString FROM 1 FOR 24));


SET OutputRoot.XML.ServicingPlannerToAccountReassignmentNotification.RelationshipTimestamp = TimeString1;

I get the output:

TIMESTAMP '2003-08-03 11,

while i want just the year part.. Do advise
Back to top
View user's profile Send private message
kirani
PostPosted: Sun Aug 03, 2003 1:32 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Use this ..
Code:

SET OutputRoot.XML.ServicingPlannerToAccountReassignmentNotification.RelationshipTimestamp =  SUBSTRING(CURRENT_TIMESTAMP FROM 11 FOR 26)

to get current timestamp into CCYY-MM-DD HH:MM:SS.nnnnnn format. If you want different format then you can manipulate this string using STRING ESQL function to get desired output.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
EddieA
PostPosted: Sun Aug 03, 2003 2:14 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

If you want just the year, then use:

SET TimeString1 = (SUBSTRING (TimeString FROM 12 FOR 4));

Simple really.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
j1
PostPosted: Mon Aug 04, 2003 6:08 am    Post subject: Reply with quote

Centurion

Joined: 23 Jun 2003
Posts: 139

Thanks Guys!!! Problem Resolved
Back to top
View user's profile Send private message
skn
PostPosted: Mon Aug 04, 2003 7:15 am    Post subject: Reply with quote

Centurion

Joined: 21 May 2003
Posts: 112
Location: Dallas

sorry to jump in.if i use get_time at the beggining of my ESQL and at the end do they return the same values(at least thats the impression i got from the manual).what time does the function give then?
Back to top
View user's profile Send private message
j1
PostPosted: Mon Aug 04, 2003 7:24 am    Post subject: Reply with quote

Centurion

Joined: 23 Jun 2003
Posts: 139

As far as i know ...It does return the same time. It also says so in the
ESQL reference book...
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 » Getting current system date and time
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.