PHP时间为1小时[重复]

This question already has an answer here:

I've already set the timezone setting in php.ini but its 1 hour ahead of the timezone I have set.

I thought this would be covered already in here, but the only solution I can find is telling me to check the timezone, which I have and it's correct.

I have "America/Toronto" set. I live in Toronto and it's not the right time.

The solution to the question marked as duplicate did not work for me.

Is there something about day light savings I need to check?

</div>

Just use date_default_timezone_set("Europe/Ljubljana"); in your PHP file that is included in other files (like config or something similar).

To change your timezone in php.ini properly then use date.timezone = "Europe/Ljubljana" on top of the file.

Also check list of supported PHP timezones.

If you've set your timezone to a non-geographical setting, then it will never reflect daylight savings time, so "GMT" will always be equal to UTC as it is non-geographical.

If you set your timezone to a geographical location then if that place has DST then it will be reflected in the timezone. For example "Europe/London" is UTC in the winter and UTC+1 in the summer, as per the local time.

There are places that do not observe DST though, so in the USA "America/Denver" is Mountain Time with DST, and "America/Phoenix" is without DST.

You can find a list of all valid PHP timezones at http://php.net/manual/en/timezones.php

Hope this make sense.