View previous topic :: View next topic
|
Author |
Message |
thespider390
New User
Joined: 28 May 2010 Posts: 3 Location: New Delhi
|
|
|
|
Here is my requirement:-
I need to fetch 2 time stamps from DB2 table. IN and OUT. It is done .
Now I have to calculate the difference of time. I'm able to do that easily is HH:MM:SS as far as it is the same date(daye) like in time is on 24/july/2010 at any time and OUT time is on the same day, some time later.
My problem is when In time is on 24/July/2010 and out time is after few days, let say 27/july/2010. Now I do not know how to tell my program about days.
Same problem occurs if Transaction IN is on 24/july/2010 at 11:20:30 PM and out on 25/July/2010 at 00:18:38 am. Please give me a good approach. I need HH:MM:SS or maybe Day can be included later on my project.
Thanks |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
DB2 is very good at calculating the difference between two timestamps! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well something happened to the post of naziashaffi,
and I created a fun response,
but it seems someone had deleted the original post.
so, I have to edit mine.
deleted sarcasm
timestamp arithmetic,
more deleted sarcasm |
|
Back to top |
|
|
|