[plug] Database time fields and DST

Adrian Chadd adrian at creative.net.au
Sun Mar 25 07:46:41 WST 2007


On Sun, Mar 25, 2007, Brad Campbell wrote:
> 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.

* Use UTC time; have the library of your choice handle converting the
  current timezone + time into UTC time.
* Then you don't have to worry about a DST bit at all.




Adrian




More information about the plug mailing list