I want to get the start and end date of the previous calendar month.
So, it is July 2012 Now, I have to start as a function and return to the end on June 30, 2012.
This is my code:
$ current_month = date ("Ym-01 00:00:00"); $ Start_month = strtotime (date ("Y-M-D", strotom ($ current_ month). "-1 month")); $ End_month = strtotime (date ("Y-M-D", strotomom ($ current_member). "-1 second"); Resonance "Start month:" Date ('Y-M-D', $ start_ month) " (". $ Start_month.")
"Resonance Month:" Date ('Y-M-D', $ end_moth) "(". $ End_month. ") & Lt; br & Gt; "; But this resonates:
Start month: 2012-07-01 (13410 9 3600) End month: 2012-07- 01 (13410 9 3600) What am I doing with any idea?
posted by you Od, you need to move your wide bracket slightly toward you it was. :)
& lt ;? Php $ current_month = date ("Y-M-01 00:00:00"); $ Start_month = strtotime (date ("Y-M-D", strotomom ($ current_moth. "-1 month"))); $ End_month = strtotime (date ("Y-M-D", strotomom ($ current_ month. "-1 day"))); Echo "Start month:" Date ('Y-M-D, $ start_ month) "(". $ Start_month. ")
"; Echo "Expiration Month:" Date ('Y-M-D', $ end_moth) "(". $ End_month. ")
"; ? & Gt;
Comments
Post a Comment