If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > To TimeStamp Conversion, Please Help!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-09, 21:46
bavirisetty bavirisetty is offline
Registered User
 
Join Date: Sep 2009
Posts: 4
To TimeStamp Conversion, Please Help!!

Can someone please help me how to convert date to timestamp. For example:

10/04/2009 to 2009-10-04 00:00:00
Reply With Quote
  #2 (permalink)  
Old 10-04-09, 22:30
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
bavirisetty, check out this link (it if for DB2 LUW V9.7 since you didn't mention DB2 version or operating system) for Scalar functions - IBM DB2 9.7 for Linux, UNIX, and Windows

Functions are your friends. read up on them and remember them when you need to do something. They are very useful.

Specifically, look up the TIMESTAMP function.

TIMESTAMP('2009-10-04', '00.00.00')

There are other ways to accomplish the same task.
Reply With Quote
  #3 (permalink)  
Old 10-05-09, 03:02
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
Quote:
Originally Posted by Stealth_DBA
There are other ways to accomplish the same task.
TIMESTAMP_ISO is another fnc.
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #4 (permalink)  
Old 10-06-09, 12:06
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
DB2 9.7 for LUW supports TIMESTAMP('10/04/2009').
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On