David,

Yes, I deal with most of this at work, except daylight savings. (Timestamps in astronomical observations are predominantly in UTC or rarely TT/TDB, I never saw local time.)

Best regards,

Dmitry


On 10/20/2016 07:26 PM, David Storrs wrote:
Also be aware that once you start getting into date math you need to deal with:

*) Minutes that might have 61 seconds in them. Yes, hh:mm:60 is a real time.

*) Hours that don't exist.

*) Hours that happen twice in the same day.

*) Februaries that have 28 or 29 days on a weird schedule. (If the year is divisible by 4, unless it's divisible by 100, unless it's divisible by 400.)

*) Two weeks that didn't exist due to calendars switching over.

*) The modern calendar being adopted at different points in different countries. Greece didn't start using it until 1923.

On Thu, Oct 20, 2016 at 12:13 PM, Matthew Flatt <mfl...@cs.utah.edu <mailto:mfl...@cs.utah.edu>> wrote:

    Did you timezone use daylight saving in 1996?

    In U.S. timezones, March (it used to be April) has a 1-hour hole
    due to
    the switch to daylight saving time, where the clock skips forward from
    1:59am to 3:00am. For example, 2:47:59am on March 13, 2016 really did
    not exist in my timezone.

    At Thu, 20 Oct 2016 19:05:38 +0300, Dmitry Pavlov wrote:
    > Hello,
    >
    > The surprise of the day for me is date->seconds
    > rejecting a particular time on a particular date.
    >
    > (date->seconds (date 59 47 2 31 3 1996 0 0 #f 0))
    >
    > This should be 1996, March 31, 02:47:59 am, correct?
    >
    >
    > It reports the following error:
    >
    > find-seconds: non-existent date
    >    wanted: (59 47 2 31 3 1996)
    >    nearest below: 828226799 is (59 59 1 31 3 1996)
    >    nearest above: 828226800 is (0 0 3 31 3 1996)
    >    context...:
    >     /opt/racket/collects/racket/date.rkt:234:0: date->seconds
> /opt/racket/collects/racket/contract/private/arrow-val-first.rkt:306:25
    >     /opt/racket/collects/racket/private/misc.rkt:88:7
    >
    >  From the message, I can suppose that it misses a whole hour inside.
    >
    > What can be done?
    >
    > This is Racket 6.6 on Linux.
    >
    >
    > Best regards,
    >
    > Dmitry
    >
    > --
    > You received this message because you are subscribed to the
    Google Groups
    > "Racket Users" group.
    > To unsubscribe from this group and stop receiving emails from
    it, send an
    > email to racket-users+unsubscr...@googlegroups.com
    <mailto:racket-users%2bunsubscr...@googlegroups.com>.
    > For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

    --
    You received this message because you are subscribed to the Google
    Groups "Racket Users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to racket-users+unsubscr...@googlegroups.com
    <mailto:racket-users%2bunsubscr...@googlegroups.com>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.



--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to