Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone not set #4

Closed
rabol opened this issue Nov 7, 2011 · 3 comments
Closed

Timezone not set #4

rabol opened this issue Nov 7, 2011 · 3 comments
Labels
Milestone

Comments

@rabol
Copy link

rabol commented Nov 7, 2011

Timezone should be set before using any time related functions otherwise your /tmp/logs/error.log will be full of warnings (and slow down the system)

@quickapps
Copy link
Owner

This is actually set on controller "bootstrap", this is before controller's beforeFilter().
In Quickapps component, on initialize(); after load enviroment variables and user access checking process.
So it is actually set before using any time related function.

Are you getting timezone-related warnings?
This may be caused by other reason, because demo site and other tests installations doesnt show any time-related warning in error.log

@rabol
Copy link
Author

rabol commented Nov 7, 2011

yes I get time zone warnings:
2011-11-07 10:45:13 Warning: Warning (2): strtotime(): 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 'Europe/Berlin' for 'CET/1.0/no DST' instead in [/Web/quickapps/QuickApps-CMS/app/Cake/Network/CakeResponse.php, line 631]
Trace:
strtotime - [internal], line ??
CakeResponse::cache() - APP/Cake/Network/CakeResponse.php, line 631
Dispatcher::_deliverAsset() - APP/Cake/Routing/Dispatcher.php, line 321
Dispatcher::asset() - APP/Cake/Routing/Dispatcher.php, line 293
Dispatcher::dispatch() - APP/Cake/Routing/Dispatcher.php, line 74
[main] - APP/webroot/index.php, line 81

I fixed it by adding a few lines to my .htaccess

System:
Darwin Steens-iMac 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
Apache/2.2.20 (Unix) DAV/2 PHP/5.3.6 with Suhosin-Patch
PHP v. 5.3.6

@quickapps
Copy link
Owner

Interesting,
But this warining is showing up on Dispatch process, this is just before load bootstrap.php.
So teorically you should get this warning in any cakePHP application.

Check the date.timezone ini option in your php.ini file. And make sure you have a value set on it.

(cakePHP use time functions on Dispatch process for setting up header info and creating Cache Files)

http://hints.macworld.com/article.php?story=20090831101932728

Notify me when you fix it to close this ticket :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants