Timezone: 1 hour difference between database and dol_now();

Hi Dollibarians,
Since the switch to standard time, I’ve encountered the following problem:
When running the SQL command:

INSERT INTO llx_printertradeproduction_rli_lavorazioni (fk_RLI, fk_user, start_date, fk_statut, with_lot) VALUES(75,1,'2025-11-02 13:59:57',1,FALSE)

I see the following record in the database:
immagine
mind the instruction:
dol_print_date($objp->start_date, 'dayhour')
produces this output:

This is the server’s PHP settings (Rel. 8.3.14):

Thanks for the help

Hi @mgribaudo

It’s happening due to Dolibarr’s date print function, which uses a parameter to format and display the date and time based on the current user’s timezone. The parameter ‘tzuserrel’ is used to handle timezones relative to the user’s settings.

Thanks
Saikat Koley
Software Developer(Dolibarr)
Call/WhatsApp : +919903256573
https://www.linkedin.com/in/saikatkoley/

Thanks Saikat,
you are a great resource for the community :slightly_smiling_face:
in fact by putting the 3rd parameter

dol_print_date($objp->start_date, 'dayhour', 'tzuserrel')

things went right

1 Like