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

date_default_timezone_set('Asia/Shanghai'); #411

Closed
morozovsk opened this issue Apr 4, 2019 · 1 comment
Closed

date_default_timezone_set('Asia/Shanghai'); #411

morozovsk opened this issue Apr 4, 2019 · 1 comment

Comments

@morozovsk
Copy link

morozovsk commented Apr 4, 2019

Remove it please.
By default PHP uses timezone of server.
All my php scripts use right timezone exept workerman.
If you use 'Asia/Shanghai' as timezone on your server then your php uses 'Asia/Shanghai'.
If you use 'UTC' as timezone on your server but you want to use in php 'Asia/Shanghai' then you need change timezone in your php.ini or in your php script but you don't need to change it for all users of your library.
I don't need setup every settings twice (per system and per php).

I couldn't change every php.ini files on on every server so now I have to use:

if (!ini_get('date.timezone')) {
    ini_set('date.timezone', exec('date +"%Z"'));
}

But it's stupid.

walkor added a commit that referenced this issue Apr 5, 2019
@walkor
Copy link
Owner

walkor commented Apr 5, 2019

You are right.
The codes removed.
Thank you for your posts. 👍

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

No branches or pull requests

2 participants