bug-gnustep
[Top][All Lists]
Advanced

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

[bug #18088] -[NSCalendarDate dateByAddingYears:months:days:hours:minute


From: David Ayers
Subject: [bug #18088] -[NSCalendarDate dateByAddingYears:months:days:hours:minutes:seconds:] doesn't handle month boundries as expected
Date: Mon, 23 Oct 2006 10:42:17 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7.10) Gecko/20060927 Firefox/1.0.4 (Debian package 1.0.4-2sarge12)

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

                 Summary: -[NSCalendarDate
dateByAddingYears:months:days:hours:minutes:seconds:] doesn't handle month
boundries as expected
                 Project: GNUstep
            Submitted by: ayers
            Submitted on: Monday 10/23/2006 at 12:42
                Category: Base/Foundation
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open

    _______________________________________________________

Details:

(see: testsuite/base/NSCalendarDate/test00.m)

date: 2006-10-01 00:00:00 +0100
dateByAddingYears: 0 months:   1 days:    0
            hours: 2 minutes: 10 seconds: 0
expected result
date: 2006-11-01 02:10:00 +0100
actual result
date: 2006-10-31 02:10:00 +0000

What happens conceptually is...
the date is "normalized" to GMT:
2006-09-30 23:00:00 +0000

the month is added:
2006-10-30 23:00:00 +0000

the hours are added:
2006-10-30 25:00:00 +0000
2006-10-31 01:00:00 +0000

the minutes are added:
2006-10-31 01:10:00 +0000

the time zone offset is added:
2006-10-31 02:10:00 +0000

So there are actually two issues.

1) basing the calculation on GMT is giving unexpected results in cases when
month boundries are crossed.
2) the time zone is not preserved.

I'm not sure what the correct approach to fixing this is.







    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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