• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Wrong Time zone in PHP

flex1

New Pleskian
Hey Guys,
I migrated my Plesk installation to another server. All services are working but today I recognized that the time zone in PHP seems to be wrong. In the plesk settings (system time settings) the time zone (Europe/Berlin) is correct und the time outputted via SSH is correct, too. But if I run
PHP:
echo date("d.m.Y H:i:s");
the time is wrong. It's 1 hour behind. PHPInfo shows the time zone "UTC". It is possible to change that time zone to that zone, which is set in Plesk?


Thank you very much!
 
Check php.ini file

for OS php > /etc/php.ini
for Plesk PHP > /opt/plesk/php/<php verison>/etc/php.ini
 
Hello,

I am using Plesk onxy version 17.5.3 Update #55 on windows server 2012 R2.
some of customers are using php and need to use set time on their website. but there is 1 hrs different in any time zone they're using. for example if the current time is 02:00 his website shows 03:00 as wrong.

I have checked a lot of documents and the discussion on talk.plesk.com and also support.plesk.com. but issue is still doesn't resolved.

I've set date.timezone directly on php.ini in tools&settings on admin area also I've set this function trough the our customer account in his php settings by adding line, I also have set this function in pleskdir > admin > conf > php.ini
and did other things that suggested but result is the same!

I'm be gracefull if you suggest me a solution to solve this issue.

Thanks.
 
Have you checked that the server time (date command) returns the local time or is your server syncing to a network time elsewhere?
 
Have you checked that the server time (date command) returns the local time or is your server syncing to a network time elsewhere?
Server is using Windows server 2012 R2 and not Linux. But the server time is correct but just php time has issue.
 
1. Login to Plesk
2. Tools and Settings > PHP Settings > Click on the PHP handler (version) you are using
3. Click on php.ini
4. Edit the timezone in that file and change it to your location, e.g. Europe/Amsterdam, save the file.
 
Back
Top