How do you get the time passed ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
scheinarts
Forum Commoner
Posts: 52
Joined: Wed Jul 25, 2007 2:37 am

How do you get the time passed ?

Post by scheinarts »

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?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: How do you get the time passed ?

Post by aceconcepts »

scheinarts
Forum Commoner
Posts: 52
Joined: Wed Jul 25, 2007 2:37 am

Re: How do you get the time passed ?

Post by scheinarts »

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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How do you get the time passed ?

Post by pickle »

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.
Post Reply