Answer the question
In order to leave comments, you need to log in
What causes the DateTime error?
Good day to all!
There is such a piece
$month_now_first_day = new datetime('first day of 0 month midnight');
$month_now_last_day = new datetime('last day of 0 month midnight');
$month_now_first_day_in_time = strtotime($month_now_first_day->format('Y-m-d H:i:s'));
$month_now_last_day_in_time = strtotime($month_now_last_day->format('Y-m-d H:i:s'));
$month_now_text = strftime("%B", $month_now_first_day_in_time);
date_default_timezone_set('Asia/Novosibirsk');
inserted before script, plus htaccess lineSetEnv TZ UTC+06:00
without it, 500 error at the server o_O Answer the question
In order to leave comments, you need to log in
new datetime('first day of 0 month midnight');
What kind of format is this? It would probably be more correct like this:
new DateTime("2013-11-21 10:01:37");
new DateTime();
You are formatting the date incorrectly.
Try:
00:00 1st Jan
00:00 last day of Jan
date('Y-m-d H:i:s', strtotime('00:00 1st Jan'));
date('Y-m-d H:i:s', strtotime('00:00 last day of Jan'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question