paulspoon Posted July 13, 2006 Share Posted July 13, 2006 I've got the following :[code]$grvdate = date("Y-m-d");[/code]How can I subtract three days from todays date and use it in a further query ?Regards Link to comment https://forums.phpfreaks.com/topic/14481-date-calculation/ Share on other sites More sharing options...
brown2005 Posted July 13, 2006 Share Posted July 13, 2006 $tomorrow = mktime(0, 0, 0, date("m") , date("d")-3, date("Y")); Link to comment https://forums.phpfreaks.com/topic/14481-date-calculation/#findComment-57295 Share on other sites More sharing options...
brown2005 Posted July 13, 2006 Share Posted July 13, 2006 check the date() function http://www.phpfreaks.com/phpmanual/page/function.date.html Link to comment https://forums.phpfreaks.com/topic/14481-date-calculation/#findComment-57296 Share on other sites More sharing options...
zq29 Posted July 13, 2006 Share Posted July 13, 2006 [code=php:0]date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));[/code][b]EDIT:[/b] Beaten to it! Link to comment https://forums.phpfreaks.com/topic/14481-date-calculation/#findComment-57297 Share on other sites More sharing options...
kenrbnsn Posted July 13, 2006 Share Posted July 13, 2006 You can use:[code]<?php $threedaysago = date("Y-m-d",strtotime("-3 days")); ?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/14481-date-calculation/#findComment-57298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.