How do you get the time passed ?
Moderator: General Moderators
-
scheinarts
- Forum Commoner
- Posts: 52
- Joined: Wed Jul 25, 2007 2:37 am
How do you get the time passed ?
If you have a in the MySQL data base a column called created_date, which gets stores the created time of the row... how do I determine the elapsed days or hours or minutes since that record was created from the current time now?
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: How do you get the time passed ?
Take a look at http://uk.php.net/strtotime
-
scheinarts
- Forum Commoner
- Posts: 52
- Joined: Wed Jul 25, 2007 2:37 am
Re: How do you get the time passed ?
i checked it out but im not clear on how it would work for what i need it to do. Can some one maybe post an example
Re: How do you get the time passed ?
UNIX timestamps are seconds. So subtracting the time of creation from the now, you'll get the elapsed seconds.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.