unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #29575] SRFI-19 conversion issue
@ 2010-04-16  9:08 anonymous
  2010-04-16  9:09 ` anonymous
  0 siblings, 1 reply; 7+ messages in thread
From: anonymous @ 2010-04-16  9:08 UTC (permalink / raw)
  To: bug-guile


URL:
  <http://savannah.gnu.org/bugs/?29575>

                 Summary: SRFI-19 conversion issue
                 Project: Guile
            Submitted by: None
            Submitted on: Fri 16 Apr 2010 09:08:21 AM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Using SRFI-19, converting from string->date->time-utc, adding a duration, and
converting back time->utc->date->string returns an incorrect result, but
apparently on only specific dates.

Code to reproduce:

(use-modules (srfi srfi-19))

(define one-day-duration
  (time-difference (date->time-utc (string->date "20100102" "~Y~m~d"))
                   (date->time-utc (string->date "20100101" "~Y~m~d"))))

(define +day
  (lambda (yyyymmdd)
    "Add one day to date string"
    (date->string
     (time-utc->date
      (add-duration (date->time-utc (string->date yyyymmdd "~Y~m~d"))
one-day-duration))
     "~Y~m~d")))

(+day "20091102")

=> "20091103"  Correct.

(+day "20091101")

=> "20091101"  ERROR!

(+day "20081101")

=> "20081102"  Correct.

(+day "20081102")

=> "20081102"  ERROR!

(+day "20071103")

=> "20071104"  Correct.

(+day "20071104")

=> "20071104"  ERROR!


And so forth.

From what I have seen, only the beginning of November seems to be the issue
-- I have used these functions to get every date for 2007, 2008 and 2009, and
those were the only issues I''ve seen so far.

HTH.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29575>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





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

end of thread, other threads:[~2011-10-22 15:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-16  9:08 [bug #29575] SRFI-19 conversion issue anonymous
2010-04-16  9:09 ` anonymous
2010-04-16 11:52   ` anonymous
2010-04-16 13:51     ` Ludovic Courtès
2011-02-13 13:57       ` Ludovic Courtès
2011-10-22 14:24         ` bug#9838: " Ludovic Courtès
2011-10-22 15:59           ` Ludovic Courtès

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).