Skip to content
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

AsDateTimeOffset return wrong offset for America/mexico_city time zone #573

Open
ShenChen93 opened this issue May 3, 2023 · 1 comment

Comments

@ShenChen93
Copy link

ShenChen93 commented May 3, 2023

I get the nextOccurent which is of type IDateTime by following code:

var occurrences = calendar.GetOccurrences(searchStartTime, searchEndTime);
var nextOccurence = occurrences.First().Period.StartTime;

It has value "4/30/2023 9:00:00 PM america/mexico_city", but AsDateTimeOffset return wrong offset (It return -05:00, but it should be -06:00)

{4/30/2023 9:00:00 PM america/mexico_city}
    AsDateTimeOffset: {4/30/2023 9:00:00 PM -05:00}
    AsSystemLocal: {4/30/2023 9:00:00 PM}
    AsUtc: {5/1/2023 4:00:00 AM}
    AssociatedObject: Component: "VEVENT"
    Calendar: Component: "VCALENDAR"
    Date: {4/30/2023 12:00:00 AM}
    Day: 30
    DayOfWeek: Sunday
    DayOfYear: 120
    Encoding: null
    HasDate: true
    HasTime: true
    Hour: 21
    IsUtc: false
    Language: null
    Millisecond: 0
    Minute: 0
    Month: 4
    Parameters: {Ical.Net.Proxies.ParameterCollectionProxy}
    Second: 0
    Ticks: 638184852000000000
    TimeOfDay: {21:00:00}
    TimeZoneName: "america/mexico_city"
    TzId: "america/mexico_city"
    Value: {4/30/2023 9:00:00 PM}
    Year: 2023
    _AssociatedObject: Component: "VEVENT"
@ShenChen93
Copy link
Author

Not sure if it due to mexico_city no longer use DST starting from this year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant