代码之家  ›  专栏  ›  技术社区  ›  sdot257

用strtotime计算未来日期不正确

php
  •  1
  • sdot257  · 技术社区  · 15 年前

    如果我在strtotime函数中运行“next saturday”,它将显示4/3/2010作为日期。为什么不显示4/10?

    3 回复  |  直到 15 年前
        1
  •  1
  •   Brant Messenger    15 年前

    Other Timezones

    date_default_timezone_set("Etc/GMT-5");
    $time = strtotime('Saturday +7 day');
    $date = date("m/d/Y",$time);
    
        2
  •  0
  •   Leo    15 年前

    尝试:

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

    或者编辑php.ini

        3
  •  -1
  •   sdot257    15 年前

    知道了。。。

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