[GH-ISSUE #108] date_default_timezone_get() error #36

Closed
opened 2026-03-04 02:11:33 +03:00 by kerem · 7 comments
Owner

Originally created by @ghost on GitHub (Aug 27, 2012).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/108

I have recently run the composer update and got the following error:

date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in ...vendor/monolog/monolog/src/Monolog/Logger.php line 112

Originally created by @ghost on GitHub (Aug 27, 2012). Original GitHub issue: https://github.com/Seldaek/monolog/issues/108 I have recently run the composer update and got the following error: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are _required_ to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in ...vendor/monolog/monolog/src/Monolog/Logger.php line 112
kerem closed this issue 2026-03-04 02:11:33 +03:00
Author
Owner

@stof commented on GitHub (Aug 27, 2012):

This is absolutely not a bug in composer but in your PHP config: http://fr.php.net/date_default_timezone_get

<!-- gh-comment-id:8067562 --> @stof commented on GitHub (Aug 27, 2012): This is absolutely not a bug in composer but in your PHP config: http://fr.php.net/date_default_timezone_get
Author
Owner

@Seldaek commented on GitHub (Aug 28, 2012):

Yup sorry but we can't help here, you need to set up your timezone in php.ini

<!-- gh-comment-id:8087989 --> @Seldaek commented on GitHub (Aug 28, 2012): Yup sorry but we can't help here, you need to set up your timezone in php.ini
Author
Owner

@ghost commented on GitHub (Aug 28, 2012):

I'm using MAMP with php 5.3.6:

[Date]
; Defines the default timezone used by the date functions
; Will be changed by MAMP to system timezone
date.timezone = "America/Los_Angeles"

and I still get the error? any idea?

<!-- gh-comment-id:8089204 --> @ghost commented on GitHub (Aug 28, 2012): I'm using MAMP with php 5.3.6: [Date] ; Defines the default timezone used by the date functions ; Will be changed by MAMP to system timezone date.timezone = "America/Los_Angeles" and I still get the error? any idea?
Author
Owner

@stof commented on GitHub (Aug 28, 2012):

check that it is really the php.ini file which is used when the code was run.

<!-- gh-comment-id:8091380 --> @stof commented on GitHub (Aug 28, 2012): check that it is really the php.ini file which is used when the code was run.
Author
Owner

@ghost commented on GitHub (Aug 28, 2012):

I upgraded to the newest MAMP and it works now.Thanks.

<!-- gh-comment-id:8091515 --> @ghost commented on GitHub (Aug 28, 2012): I upgraded to the newest MAMP and it works now.Thanks.
Author
Owner

@FilipDA commented on GitHub (Jan 26, 2013):

For people that get the error with a correct setting in php.ini.
Check the TZ Environment Variable. To set your timezone (Linux / UNIX), use the command line :
export TZ="Europe/Paris"
(edit your .bash_profile to make the TZ changes permanent).

<!-- gh-comment-id:12742390 --> @FilipDA commented on GitHub (Jan 26, 2013): For people that get the error with a correct setting in php.ini. Check the TZ Environment Variable. To set your timezone (Linux / UNIX), use the command line : export TZ="Europe/Paris" (edit your .bash_profile to make the TZ changes permanent).
Author
Owner

@karol-haltenberger commented on GitHub (Feb 21, 2014):

composer does not run through the web server, but in the cli so if the two have a separate config file, timezone has to be set in the cli's php.ini

<!-- gh-comment-id:35737654 --> @karol-haltenberger commented on GitHub (Feb 21, 2014): composer does not run through the web server, but in the cli so if the two have a separate config file, timezone has to be set in the cli's php.ini
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#36
No description provided.