[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #29575] SRFI-19 conversion issue

From: anonymous
Subject: [bug #29575] SRFI-19 conversion issue
Date: Fri, 16 Apr 2010 09:08:21 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100401 SUSE/3.6.3-1.2 Firefox/3.6.3


                 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



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"
      (add-duration (date->time-utc (string->date yyyymmdd "~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.



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]