I need to store the summer time (daylight saving time) change-over rules for different world regions in a database. I already have a way of storing regions and sub-regions (so the whole "half of Australia"/Arizona/Navaho problem is taken care of), but I'm wondering what the most efficient schema would be to accomplish this. The two options as I see them:
- Have a table which contains unique one row for each year and region giving the start and end times for summer time as well as the specific offset
- Have a table which stores a formula and effective date range for each region (effective range required for regions like Israel)
The advantage to the first is flexibility, since literally anything is possible. Unfortunately, it also requires (a) more space, and correspondingly (b) a lot of work to get the data input. The second is nice because one row could correspond to one region for decades, but it also requires some sort of language parser and interpreter in the application layer. Since this database will be used by several different applications written in languages without powerful text processing capabilities, I would rather avoid that route.
I would love to just use zoneinfo or something like that, but unfortunately that's not an option in this case. Likewise, I cannot normalize the dates, timezone and summer time info must be in the database to satisfy certain use cases.
Does anybody have any experience doing something similar? Likewise, does anyone have any brilliant options that I may have missed?