tags:

views:

24

answers:

1

Hi there,

I have two dates in mysql,

I can get the difference(in seconds) by doing date1 - date2.

Now I need to show x days, x hours, x minutes, x seconds

If there are 0 days then it will simply be x hours, x minutes, x seconds.

So,

What is the best way to do this?

note: 3650 seconds will show as 1 hour, 0 minutes, 50 seconds.

So do i use modulus? or ...

+1  A: 

This function will be helpful:

http://aidanlister.com/2004/04/making-time-periods-readable/

cnanney