简体   繁体   中英

How can I modify php date in bitnami?

I have read other StachOverflow answers and forums about php and date but they did not help me. I am using bitnami in a Azure server and use date in the shell I get

Wed May 4 10:25:16 UTC 2016

. But with php date("dmy/H:i:s") function y get

04-05-16/03:18:51

I have changed the timezone from date.timezone = America/Los_Angeles to date.timezone = Europe/Paris in php.ini file that is in

opt/bitnami/php/etc

The file is modified I have permission to do it and if I do cat php.ini | grep date.timezone I get ;

http://php.net/date.timezone

date.timezone = "Europe/Paris"

I have restarted apache with

sudo /opt/bitnami/ctlscript.sh restart apache

But the time is still wrong. Besides, if I use phpinfo() , date.timezone is also wrong: America/Los_Angeles

Do I need to restart something more? What more I have to do to get the correct time?

Try date_default_timezone_set() in the beginning of your script: date_default_timezone_set('Europe/Paris');

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM