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 Quote 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")); Quote 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 Quote 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! Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/14481-date-calculation/#findComment-57298 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.