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 » Timestamp Question

Post new topic  Reply to topic
 Timestamp Question « View previous topic :: View next topic » 
Author Message
CAONIMA
PostPosted: Tue Sep 01, 2015 5:19 am    Post subject: Timestamp Question Reply with quote

Acolyte

Joined: 03 Dec 2014
Posts: 65

Hi All,

I have one timestamp format pattern question.

I declare the pattern as
Quote:
'yyyy-MM-dd HH:mm:ss'


And I use the cast function:

Quote:
CAST(CURRENT_TIMESTAMP as TIMESTAMP FORMAT pattern)


And I get the result like:
Quote:
'2015-09-01 09:09:12.325'


But I have to get the time like
Quote:
'2015-09-01 09:09:12'


I want to drop the millisecond.

How can I do that ?

Many thanks!
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 01, 2015 5:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

CAST to a CHARACTER not a TIMESTAMP if you want a character string without a millisecond (as described by your pattern) rather than a TIMESTAMP which always goes to the millisecond.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
inMo
PostPosted: Tue Sep 01, 2015 5:38 am    Post subject: Reply with quote

Master

Joined: 27 Jun 2009
Posts: 216
Location: NY

Are you sure you want to cast the CURRENT_TIMESTAMP as a timestamp?
Back to top
View user's profile Send private message
CAONIMA
PostPosted: Tue Sep 01, 2015 5:56 am    Post subject: Reply with quote

Acolyte

Joined: 03 Dec 2014
Posts: 65

Vitor wrote:
CAST to a CHARACTER not a TIMESTAMP if you want a character string without a millisecond (as described by your pattern) rather than a TIMESTAMP which always goes to the millisecond.


Thank you for all your reply.

The problem solved after I changed it to Char.
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 » Timestamp Question
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.