Why does strtotime give different result in different timezone?

前端 未结 6 456
迷失自我
迷失自我 2020-12-11 18:34

I am not sure why strtotime() in PHP returns different result in different timezone even though same date is given as parameter, does anyone know the answer? I

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 18:47

    From the PHP manual:

    This function will use the TZ environment variable (if available) to calculate the timestamp. Since PHP 5.1.0 there are easier ways to define the timezone that is used across all date/time functions. That process is explained in the date_default_timezone_get() function page.

    http://php.net/manual/en/function.strtotime.php

提交回复
热议问题