Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to get the difference of timestamps in DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
venkata.bellala

New User


Joined: 11 Mar 2005
Posts: 4

PostPosted: Tue May 17, 2005 12:00 pm    Post subject: How to get the difference of timestamps in DB2
Reply with quote

Hi,
How to get the difference of timestamps in DB2

regards,
Venkata Bellala
Back to top
View user's profile Send private message

ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Tue May 17, 2005 1:06 pm    Post subject:
Reply with quote

Hi Venkata,

You can use - (Minus) between two Time stamps to find out the difference. The result will be in the form of seconds. If you want to convert it into days,months or years we can use some calculation.

Eg: select CRTTMSTP,current timestamp,current timestamp-CRTTMSTP
from user.table;
(It returns the difference between current time stamp and create time stamp in seconds)

select CRTTMSTP,current timestamp,(current timestamp-CRTTMSTP)/(60*60*24) from user.table;
(It returns the difference between current time stamp and create time stamp in days)

Thanks,
Reddy.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts Difference Between CICS WebSupport an... sachinji84 CICS 1 Mon Mar 07, 2016 7:25 pm
No new posts Difference between -180 and -181 with... deepak_shrivastava DB2 4 Wed Jan 06, 2016 10:00 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us