[plug] Database time fields and DST

Brad Campbell brad at wasp.net.au
Sun Mar 25 05:50:22 WST 2007


G'day all,

I'm designing a database. Not a complex one, but a database none the less.

I'm playing in a game where accuracy of timestamps is just a not negotiable, so log searches are 
performed in local time and it's pretty important that DST crossings (which may well be variable as 
we've seen) are handled smoothly.

I'm planning on making all timestamps in the database GMT but with an extra bit to signify if DST 
was active at the time, so in theory all timestamps should translate to local time perfectly 
including duplicated times when the clocks roll back.

I'm just fishing for input.. good, bad, ugly? Am I doing something dumb?
I was kinda thinking of encoding it as (time<<1)+DST or similar to keep the format uniform in the 
database while not adding extra columns or other silly conversions.

Brad
-- 
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams



More information about the plug mailing list