strftime() function showing incorrect time

后端 未结 3 519
闹比i
闹比i 2021-01-24 04:00

The strftime() function in php is not showing the correct time on my system. I am running php on xampp. Its around 11 o\'clock on my PC clock, but the function

3条回答
  •  耶瑟儿~
    2021-01-24 04:34

    You can change your servers time zone by executing an ini_set at the top:

    ini_set( 'date.timezone', 'Europe/Berlin' );

    If you're on a hosting account the server is likely in a different time zone than you are. Even if you're running something locally I usually find it's set differently.

    http://us3.php.net/timezones

提交回复
热议问题