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 > Timestamp as a result of Timestamp Difference

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-09, 01:01
bavirisetty bavirisetty is offline
Registered User
 
Join Date: Sep 2009
Posts: 4
Timestamp as a result of Timestamp Difference

I would like to get a timestamp as a result after calculating difference between two timestamps.

For example: timestamp - 13 months in terms of a timestamp
Reply With Quote
  #2 (permalink)  
Old 10-05-09, 02:00
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
you can get that in decimal format
db2 " select ( timestamp('2009-10-05-01.52.54.434868') - timestamp('2009-10-04-03.51.03.105198') ) from dual "

> 220151.329670

>> 22 hrs , 1 min, 51 sec and 329670 microsecs
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
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