unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#22033: time-utc format is lossy
@ 2015-11-27 19:38 Zefram
  2017-04-24 20:32 ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Zefram @ 2015-11-27 19:38 UTC (permalink / raw)
  To: 22033

In SRFI-19, round-tripping some UTC dates through the time-utc structure
format, for the couple of seconds around a leap second:

scheme@(guile-user)> (use-modules (srfi srfi-19))
scheme@(guile-user)> (define (tdate d) (write (list (date->string d "~4") (date->string (time-utc->date (date->time-utc d) 0) "~4"))) (newline))
scheme@(guile-user)> (tdate (make-date 0 59 59 23 30 6 2012 0))
("2012-06-30T23:59:59Z" "2012-06-30T23:59:59Z")
scheme@(guile-user)> (tdate (make-date 0 60 59 23 30 6 2012 0))
("2012-06-30T23:59:60Z" "2012-06-30T23:59:60Z")
scheme@(guile-user)> (tdate (make-date 0 0 0 0 1 7 2012 0))
("2012-07-01T00:00:00Z" "2012-06-30T23:59:60Z")
scheme@(guile-user)> (tdate (make-date 0 1 0 0 1 7 2012 0))
("2012-07-01T00:00:01Z" "2012-07-01T00:00:01Z")

Observe that the second immediately following the leap second, the
first second of the following UTC day, isn't round-tripped correctly.
It comes back as the leap second.  These two seconds are perfectly
distinct parts of the UTC time scale, and the time-utc format ought to
preserve their distinction.

-zefram





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-20 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-27 19:38 bug#22033: time-utc format is lossy Zefram
2017-04-24 20:32 ` Zefram
2018-10-20 22:08   ` Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).