comparing date's to print the day

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
invisibled
Forum Contributor
Posts: 112
Joined: Sun Apr 29, 2007 3:35 pm
Location: New Westminster

comparing date's to print the day

Post by invisibled »

Hey there, I'm trying to write some code that subtracts today's date and the date the project was completed and display just the number of days. so it would be like "completed xx days ago". I think you use the mktime function but im not sure. Any help would be great thanks!
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

This was a topic a week or two ago, a quick search should turn up the entire thread... and maybe a few more!
invisibled
Forum Contributor
Posts: 112
Joined: Sun Apr 29, 2007 3:35 pm
Location: New Westminster

Post by invisibled »

hmmm anything i found in the forums wasn't what i needed. i mean i guess i get the concept of how to do it. I just dont get exactly what php functions i need to use.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code Snippets has a thread created by printf (that's the username, not the function) which will tell you the difference in individual units.
Post Reply