开发者

Calculating future date with strtotime doesn't work properly

开发者 https://www.devze.com 2022-12-25 06:42 出处:网络
If I run \"next saturday\" into strtotime function it shows 4/3/2010 as the date. Why does it n开发者_JAVA百科ot show 4/10?Other Timezones

If I run "next saturday" into strtotime function it shows 4/3/2010 as the date. Why does it n开发者_JAVA百科ot show 4/10?


Other Timezones

date_default_timezone_set("Etc/GMT-5");
$time = strtotime('Saturday +7 day');
$date = date("m/d/Y",$time);


try:

ini_set('date.timezone', 'America/Los_Angeles');

or edit your php.ini


got it ...

strtotime('next Saturday', strtotime('+1 day'));
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号