This topic is locked

now() wrong time

4/16/2025 5:34:38 AM
PHPRunner General questions
Reiner author

I defined a field in MySQL as DATETIME. The timezone of the database is set to "Europe/Berlin".

In PHPRunner, the field is set to Read-only with the default value now().

When I save a record at 09:00:00 AM, the time stored in the field is 07:00:00 AM.

How can I fix this?

Lieben Gruß
Reiner

M
Mark Kramer 4/16/2025

The timezone diffence is most likely because of your hosting timezone is different than your local machine. Here is a good place to start. https://www.php.net/manual/en/function.date-default-timezone-set.php

Also do a seach in the forum . Fernando Humanes has a great article on the this subject. https://fhumanes.com/blog/guias-desarrollo/guia-28-situar-el-servidor-en-un-timezone-concreto/

Sergey Kornilov admin 4/18/2025

now() is a PHP function and it is based on the timezone set in PHP ( php.ini ).