Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculating dates

Status
Not open for further replies.

peterv6

Programmer
Sep 10, 2005
70
US
Can someone show me a simple way to calculate dates? What I'm trying to do is get a future or past date based on today's date. Example, if I want to know what the date is 3 weeks from now.
thanks!

PETERV
Syracuse, NY &
Boston, MA
 
Use PHP's built-in functions such as strtotime in conjunction with date().

Lots of examples to be found in the PHP online manual there.


Code:
echo '3 Weeks from now: '. date('Y-m-d', strtotime('+3 weeks')) ."\n";



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Excellent, thank you very much!

PETERV
Syracuse, NY &
Boston, MA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top