Aug 2, 2006 #1 webslinga Programmer Joined Jun 20, 2006 Messages 55 Location US All, I need a simple way to get a datetime value 7 days ago from today. Thanks.
Aug 2, 2006 #2 sleipnir214 Programmer Joined May 6, 2002 Messages 15,350 Location US Try: Code: <?php print date ('Y-m-d', strtotime ('-1 week')); ?> Want the best answers? Ask the best questions! TANSTAAFL! Upvote 0 Downvote
Try: Code: <?php print date ('Y-m-d', strtotime ('-1 week')); ?> Want the best answers? Ask the best questions! TANSTAAFL!
Aug 2, 2006 #3 cLFlaVA Programmer Joined Jun 14, 2004 Messages 6,450 Location US 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![/tt] [URL unfurl="true"]http://www.coryarthus.com/[/url] Upvote 0 Downvote
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![/tt] [URL unfurl="true"]http://www.coryarthus.com/[/url]
Aug 2, 2006 #4 cLFlaVA Programmer Joined Jun 14, 2004 Messages 6,450 Location US right. i'll keep my mouth shut. *cLFlaVA ---------------------------- [tt]somebody set up us the bomb![/tt] [URL unfurl="true"]http://www.coryarthus.com/[/url] Upvote 0 Downvote
right. i'll keep my mouth shut. *cLFlaVA ---------------------------- [tt]somebody set up us the bomb![/tt] [URL unfurl="true"]http://www.coryarthus.com/[/url]
Aug 2, 2006 Thread starter #5 webslinga Programmer Joined Jun 20, 2006 Messages 55 Location US Thanks all. Upvote 0 Downvote