Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ames!dftsrv!ukma!seismo!beno.CSS.GOV From: jean@beno.CSS.GOV (Jean Anderson) Newsgroups: comp.databases Subject: RE: Time Zones HELP! Message-ID: <49534@seismo.CSS.GOV> Date: 6 Apr 91 21:30:34 GMT Sender: usenet@seismo.CSS.GOV Organization: SAIC Geophysics Division, San Diego, California Lines: 37 In article <1991Apr5.103756.18982@news.cs.indiana.edu> vogt@iuvax.cs.indiana.edu (Michael Vogt) writes: > >What date/time format do people use when dealing with data >that crosses date and time zones? How are time changes like daylight >savings time and standard time dealt with? > We work with world wide seismic data. We store all times in GMT "epoch" time--the number of seconds since midnight January 1, 1970 (I suppose immediately tagging this as the UNIX-based system it is). By default we also display GMT rather than convert to localtime. That avoids having to know time change schedules and hour offset. For example, the USA goes on Daylight Savings this Sunday, but Norway already switched last weekend. "Let's see here....this data came from Norway so subtract 9 hours to get my PST. Oops--today subtract 10 because they already switched to Daylight Savings and we haven't yet." Three months from now it would be even worse for somebody looking at old data. Who ever remembers the exact day that each country switches from Standard to Daylight? Such confusion could result in significant errors. Epoch time is stored as a double precision float in the database, but we have library routines that convert it to a variety of human readable date/time formats. And for interactive ORACLE users, we have SQL*Plus defines specified up in the global startup file (glogin.sql) to likewise convert to human readable date/times. It is much easier to deal in GMT. +----------------------------------------------------------------------------+ | Jean Anderson, DBA email: jean@seismo.css.gov | | SAIC Geophysics Division, Mailstop 12 or: jean@esosun.css.gov | | 10210 Campus Point Drive phone: (619)458-2727 | | San Diego, CA 92121 fax: (619)458-4993 | +----------------------------------------------------------------------------+ | Any opinions are mine, not my employer's. | +----------------------------------------------------------------------------+