Handling Time Zones
Time zone differences between the server, the client browser, and the database can cause data inconsistency and confusion.
In the Broadleaf admin, the server time is used as the reference time.
When viewing entity forms in the browser, dates and times from the server are translated into the browser time zone.
Upon submitting an entity form, any dates or times are translated into the server time zone before being saved to the database.
The Broadleaf admin has a feature that allows admin users to change the time zone of their browsing session.
There is a dropdown menu in the admin header that admins can use to change the time zone that dates are displayed in.
Regardless of the browser time zone used, the server will always translate dates and times into the server time zone before saving to the database.
The database time zone is ignored in all cases. The file bl-enterprise-admin-applicationContext.xml
has bean declarations
for DatabasePlatformBehavior
that include platform-specific functions for converting timestamp strings into
timestamps. The server is responsible for creating the String in the server's timezone so that the database does not have to
do any time zone conversions.