MySQL Forums :: Newbie :: Calculating TIME ELAPSED SINCE in days OR hours OR minutes


Advanced Search

Calculating TIME ELAPSED SINCE in days OR hours OR minutes
Posted by: Dan LeGate ()
Date: February 26, 2009 06:48PM

Hi all,

I need to be able to display how many days OR hours OR minutes have elapsed by comparing a particular datetime field's date to NOW.

The reason I emphasize OR between each one is that I do NOT need to see:

3 days, 2 hours, 4 minutes.

All I would need to show is "3 days" if it's more than 24 hours.

And all I need to show is "X hours" if it's over 60 mintues and under 24 hours, and if it's under 60 minutes, I would simply show the minutes that have passed.

Does that make sense? In other words, I probably don't need all the complicated calculations found in this thread:

http://forums.mysql.com/read.php?10,135570,135726#msg-135726

but being a Newbie, I wouldn't know exactly what to exclude/change from that very intimidating example.

Any help would be MUCH appreciated.

Thanks!

Options: ReplyQuote


Subject Written By Posted
Calculating TIME ELAPSED SINCE in days OR hours OR minutes Dan LeGate 02/26/2009 06:48PM
Re: Calculating TIME ELAPSED SINCE in days OR hours OR minutes Jay Alverson 02/27/2009 09:24AM
Re: Calculating TIME ELAPSED SINCE in days OR hours OR minutes laptop alias 02/27/2009 09:41AM
Re: Calculating TIME ELAPSED SINCE in days OR hours OR minutes Dan LeGate 02/27/2009 01:02PM
Re: Calculating TIME ELAPSED SINCE in days OR hours OR minutes laptop alias 02/27/2009 04:24PM
Re: Calculating TIME ELAPSED SINCE in days OR hours OR minutes Dan LeGate 02/27/2009 05:21PM
Re: Calculating TIME ELAPSED SINCE in days OR hours OR minutes Dan LeGate 02/27/2009 05:40PM
Re: Calculating TIME ELAPSED SINCE in days OR hours OR minutes Jay Alverson 02/27/2009 08:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.