[time-nuts] Time math libraries

Tim Shoppa tshoppa at gmail.com
Mon Dec 12 19:43:23 UTC 2016


I have had some success with Perl DateTime CPAN module's support for leap
seconds - doing time delta math without using Unix Epoch Seconds properly
handles leap seconds.

Converting back and forth to Unix Epoch time works as well as it can (given
non uniqueness).

It also supports the concept of a "floating timezone" which never takes
into account leap seconds.

Tim N3QE

On Mon, Dec 12, 2016 at 1:45 PM, Eric Scace <eric at scace.org> wrote:

>    (Apologies if this question has been addressed before. Archive search
> is rather cumbersome on a month-by-month basis.)
>
>    Few people will be surprised to learn that MS Excel does not account
> for leap seconds when doing time math. See below for an example. This is
> just an example of many instances of programming failures.
>
>    Are there good time math software libraries (e.g., Java, C++/C#, etc)
> that will do time math correctly for the chosen time scale?
>
>    Thanks.
>
> — Eric
>
>
> 2016 Dec 31 Sat 23:59:57
> 2016 Dec 31 Sat 23:59:58
> 2016 Dec 31 Sat 23:59:59
> 2017 Jan 01 Sun 00:00:00
> 2017 Jan 01 Sun 00:00:01
> 2017 Jan 01 Sun 00:00:02
>
>
> My machine is on EST right now. Is it a time zone question?
>
> 2016 Dec 31 Sat 18:59:57
> 2016 Dec 31 Sat 18:59:58
> 2016 Dec 31 Sat 18:59:59
> 2016 Dec 31 Sat 19:00:00
> 2016 Dec 31 Sat 19:00:01
> 2016 Dec 31 Sat 19:00:02
>
> Nope!
>
> What about past leap seconds?
>
> 2015 Jun 30 Tue 23:59:57
> 2015 Jun 30 Tue 23:59:58
> 2015 Jun 30 Tue 23:59:59
> 2015 Jul 01 Wed 00:00:00
> 2015 Jul 01 Wed 00:00:01
> 2015 Jul 01 Wed 00:00:02
>
> Also fail!
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/
> mailman/listinfo/time-nuts
> and follow the instructions there.
>



More information about the Time-nuts_lists.febo.com mailing list