How to change the time in apache server so it matches the computer's time (PHP)?

前端 未结 4 1009
盖世英雄少女心
盖世英雄少女心 2020-12-10 11:39

In my particular case, both the server and the client are the same computer, I\'m on localhost. When i echo out the date from the date() function, it displays a totally wron

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 12:12

    This can be changed in the php.ini:

    • If using xampp, open xampp/php/php.ini.
    • Look for the line date.timezone=Europe/Berlin and change it to your timezone.
      In my case I changed to date.timezone=Africa/Nairobi.
    • Save and restart apache.

提交回复
热议问题