Path: utzoo!utgpu!watserv1!watmath!att!cbnewsb!druhi.att.com!neal From: neal@druhi.att.com (XGPB30000-McBurnettND(DR9225)289) Newsgroups: comp.sys.handhelds Subject: Re: time formats for HP28s Message-ID: <660@cbnewsb.ATT.COM> Date: 25 Jul 90 20:27:27 GMT References: <920@ncrwat.Waterloo.NCR.COM> Sender: news@cbnewsb.ATT.COM Reply-To: neal@druhi.ATT.COM (Neal D. McBurnett) Organization: AT&T Bell Labs, Denver CO Lines: 37 In article <920@ncrwat.Waterloo.NCR.COM>, jrl@images1.Waterloo.NCR.COM (john Latala) writes: |> Times are in the format HH.MMSSTT and dates are in the format MM.DDYYYY. |> |> Sorting dates in the MM.DDYYYY format doesn't work! January 1, 1991 |> (01.011991) is before July 1, 1990 (07.011990)! |> |> I was thinking about converting to something like YYYY.MMDD or even |> YYYYMMDD. |> |> After a bit more poking around I thought maybe going to a binary version |> might be a litte neater, something like #YYYYMMDDhhmmssttd. This format |> doesn't look to bad because I can get a complete date/time into one |> number, which is kind of a nice idea. |> |> In planning for when it happens how does the HP48 store/handle |> dates/times? Unfortunately, the HP48 also uses a date format which can't be sorted, like the HP41, and even HP12. I want the same characteristics you want: Both date and time in one object "<" operator works I also want negative years to work (with the "historical" semantics in which there is no year zero), and I want the precision to work down to fractions of seconds. [+-]YYYY.MMDDHHMMSS works pretty well except that some trailing precision is lost. The binary suggestion is interesting, but it is more error-prone and tedious to enter (e.g. if you enter the wrong number of digits). I think your approach of using GMT is a good one, since problems always come up with daylight savings time. Another approach is to enter numbers via one scheme and store them in another, e.g. enter as a complex (date, time) value and store as julian date (which has precision down to around a second over the last 6000 years, as I recall.) -Neal McBurnett // AT&T Bell Labs, Denver // neal@druhi.ATT.COM, att!druhi!neal