Canman2005 Posted September 3, 2007 Share Posted September 3, 2007 Hi all Just a quick question, but how would I get the number code for date() for exactly 2 months ago? Thanks Dave "Doing an all nighter again" Quote Link to comment https://forums.phpfreaks.com/topic/67722-time/ Share on other sites More sharing options...
hvle Posted September 3, 2007 Share Posted September 3, 2007 strtotime("-2 months",time()); Quote Link to comment https://forums.phpfreaks.com/topic/67722-time/#findComment-340247 Share on other sites More sharing options...
jitesh Posted September 3, 2007 Share Posted September 3, 2007 With Current Date echo date("Y-m-d",mktime(0, 0, 0, date("m")-2, date("d"),date("Y"))); echo date("Y-m-d",mktime(0, 0, 0, date("m")+2, date("d"),date("Y"))); For Dynamic echo date("Y-m-d",mktime(0, 0, 0, 1-2, 12,2007)); echo date("Y-m-d",mktime(0, 0, 0, 1+2, 12,2007)); Quote Link to comment https://forums.phpfreaks.com/topic/67722-time/#findComment-340248 Share on other sites More sharing options...
Canman2005 Posted September 3, 2007 Author Share Posted September 3, 2007 thanks Quote Link to comment https://forums.phpfreaks.com/topic/67722-time/#findComment-340269 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.