Page 1 of 1

Different user different timezone

Posted: Mon Jan 23, 2023 3:39 am
by incoherence
Hi,

I see that there is a timezone setting in the "Setup" - is that applied to all users of the system globally?

If the different users of the system are in different timezones, what is the recommended way to make nuBuilder display dates and times in their local timezone?

I do not see any per-user timezone setting in zzzzsys_user for example (that could be used to allow users to set their preferred timezone themselves).

(Do PHP or MySQL etc. perform any date/time conversion that would help (or interfere!) with this and, if so, what (timezone/setting) do they base the conversion on?).

Re: Different user different timezone

Posted: Tue Jan 24, 2023 4:08 pm
by kev1n
nuBuilder sets the timezone that is set under Setup -> Settings by running

Code: Select all

SET time_zone = ...
Documentation can be found here:
https://dev.mysql.com/doc/refman/8.0/en ... pport.html

A timezone per user is currently not supported and careful consideration must be given to how this is to be implemented.

When storing dates in a database, one way is to store them in UTC format and then convert them to the desired timezone when displaying them to the user. This ensures that the date and time are consistent across all timezones and eliminates any issues with daylight saving time.

Also see "Best way to handle storing/displaying dates in different timezones in PHP?"

https://softwareengineering.stackexchan ... s-in-mysql

and

https://softwareengineering.stackexchange.com/a/366744