Find a bug in your job:
My company server PHP default timezone and timezone are configured to America/los_angeles;
Time Stamp 1457856000,
Formatted with the date () function is 2016-03-13 00:00:00;
But after adding 3600*24-1 seconds to the timestamp, the date () function was used to format the discovery as the 2016-03-14 00:59:59;
The day before and after the date did not have such a strange phenomenon;
Does anyone know why?
Reply content:
Find a bug in your job:
My company server PHP default timezone and timezone are configured to America/los_angeles;
Time Stamp 1457856000,
Formatted with the date () function is 2016-03-13 00:00:00;
But after adding 3600*24-1 seconds to the timestamp, the date () function was used to format the discovery as the 2016-03-14 00:59:59;
The day before and after the date did not have such a strange phenomenon;
Does anyone know why?
/** * 按照你说的时间,应该就是这个时区, * 但是没什么问题,是你的计算过程出现什么没有注意到的地方, 还是不同的时区的关系 */date_default_timezone_set('Etc/GMT+8');$timeStamp = 1457856000;var_dump(date('Y-m-d H:i:s', $timeStamp));var_dump(date('Y-m-d H:i:s', $timeStamp + 3600*24-1));
Not very understanding of your problem ... The initial suspicion is due to other calculations.
There is a concept called Daylight saving time ~