I have a large application with 500 + tables, I need to convert the application to a service area (currently the application uses new java.util.Date() , GETDATE() with the server time zone). that is, no support for the time zone.
I organized this task in several steps to facilitate the development process, my first step was to change all the old dates to UTC based on the serverโs time zone. (mostly in one time zone, so this is my best guess)
Then I need to change the database and application code to save all dates in UTC with the name and timezone offset, this is where my problem arises ...
How can I modify the database / tables to maintain this in a good manner?
My ideas were as follows:
- for each date / time column in the table, add two additional columns (for tz-name and offset)
- It looks like a bad design.
- add one table with columns
pk , TABLE_NAME , COL_NAME , ROW_PK , TZ_NAME , TZ_OFFSET- although more portable, this table will contain millions of rows, as these are whole database dates, crammed into one table.
- add a new table for each existing table (one to one) with tz names and offsets for each date column
- although not portable, this seems like the best (relational) option
Does anyone have any other ideas or best practices?
epoch
source share