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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting date 7 days ago

Status
Not open for further replies.

webslinga

Programmer
Jun 20, 2006
55
US
All,
I need a simple way to get a datetime value 7 days ago from today. Thanks.
 
you can try something like:

Code:
$dateArray = getdate();
$weekAgo = mktime($dateArray['hours'], $dateArray['minutes'], $dateArray['seconds'], $dateArray['mon'], $dateArray['mday'] - 7, $dateArray['year'], );



*cLFlaVA
----------------------------
[tt]somebody set up us the bomb![bomb][/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top