-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TimeZone.AtStartofDate for day with switch to DLS in Brazil #1524
Comments
I suspect that's the problem. |
Complete example: using System;
using NodaTime;
using NodaTime.Text;
class Test
{
static void Main()
{
var zone = DateTimeZoneProviders.Bcl["E. South America Standard Time"];
var date = new LocalDate(2012, 10, 21);
var zoned = zone.AtStartOfDay(date);
Console.WriteLine(ZonedDateTimePattern.ExtendedFormatOnlyIso.Format(zoned));
}
} |
I suspect the problem is that |
for now I patched it the following way:
|
Transitions that would be represented as 24:00 in the IANA time zone database are represented as 23:59:59.999 in the Windows database. It makes sense to correct this as we have the facility to do so; the intent of the data is clearly "one millisecond later" even though that's not what the Windows rule actually says. (I don't think anyone would argue that the transition actually happens when the Windows rule says it does.) Fixes nodatime#1524.
Transitions that would be represented as 24:00 in the IANA time zone database are represented as 23:59:59.999 in the Windows database. It makes sense to correct this as we have the facility to do so; the intent of the data is clearly "one millisecond later" even though that's not what the Windows rule actually says. (I don't think anyone would argue that the transition actually happens when the Windows rule says it does.) Fixes nodatime#1524.
Transitions that would be represented as 24:00 in the IANA time zone database are represented as 23:59:59.999 in the Windows database. It makes sense to correct this as we have the facility to do so; the intent of the data is clearly "one millisecond later" even though that's not what the Windows rule actually says. (I don't think anyone would argue that the transition actually happens when the Windows rule says it does.) Fixes nodatime#1524.
Transitions that would be represented as 24:00 in the IANA time zone database are represented as 23:59:59.999 in the Windows database. It makes sense to correct this as we have the facility to do so; the intent of the data is clearly "one millisecond later" even though that's not what the Windows rule actually says. (I don't think anyone would argue that the transition actually happens when the Windows rule says it does.) Fixes #1524.
Thanks very much for raising this. It's fixed in master, and will go out as part of 3.0 (or the next beta). I won't be backporting it to 2.x. |
Thanks for fixing. When will v3.0 be released? |
I'm hoping it'll be reasonably soon - hopefully some time within May - but there are a few last bits of binary compatibility that we're looking at first. |
In my code I have the following method:
for 2012/10/21 I would assume that it returns UTC 2012-10-21-03:00 as the time is advanced in Brazil 1 hour but nothing happened yet with respect to UTC.
Then for the following day 2012/10/22 I would assume to get UTC 2012-10-22-02:00 as the missing hour leads to the shorter day 21.
However for 2012/10/21 I get instead: 2012-10-21-02:59:59.999, which is 1 ms less then expected.
This millisecond is already missing iin the AtStartOfDay result, so I assume something is wrong here?
For the following day 22 I get the full hour as expected.
Same applies for all other years for the day where the 1 hour is advanced.
BTW I use BclDateTimeZone.
The text was updated successfully, but these errors were encountered: