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" 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()); 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)); 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 Link to comment https://forums.phpfreaks.com/topic/67722-time/#findComment-340269 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.