I'm trying to change the default PHP timezone to Asia/Calcutta
by accessing the /etc/php5/cli/php.ini
file and changing
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =
to
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Asia/Calcutta"
However, when I try to view current timezone under phpinfo()
, the timezone follows the Europe/Berlin
timezone.
I have tried stopping and restarting the Apache server, but that didn't seem to have changed the settings.
Is there something I'm missing in the process?
PS: I'm using PHP 5.6.8 currently under XAMPP.
I tried all the other possible solutions posted, but none of them helped. This is what helped me save my timezone settings:
1) Go to your
phpinfo()
page and search forLoaded Configuration File
and open thephp.ini
file mentioned under that section.2) Change the default timezone settings by adding your new timezone by modifying this line:
date.timezone=Asia/Kolkata
.3) Save the
php.ini
file and stop the Apache server.4) Restart the Apache server. The timezone settings should now be modified.