Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mobile/Android] DateTime.Now is considering aborted DST on Brasília (GMT-03:00) #18443

@fl-eric

Description

@fl-eric

Brazil's Daylight Savings Time was aborted by the president last year, but mono is still considering it as active. The DST would start at 2019-11-03T00:00 (03 Nov) and would end at 2020-02-16T00:00 (16 Feb) - local times.

Steps to Reproduce

  1. Configure an Android phone setting the time zone to Brasília (GMT-03:00), Brazil (or São Paulo GMT-03:00 - Brazil);
  2. Set a date between 2019-11-03 and 2020-02-15 (inclusive).
  3. Run an app that prints the time returned by DateTime.Now.
  4. Compare the printed time to the device's time.

Please check if the system is considering (or not) the DST after changing its datetime settings. The DST should not be active and the displayed offset should be equal to -03:00.

(Also, Android's Java.Util.Date returns the correct time, you can use it to compare the dates).

Current Behavior

The time returned by DateTime.Now is one hour after the system time, and the UTC offset is -02:00 instead of -03:00.

Expected Behavior

The time returned by DateTime.Now should be equal to the system time, and the UTC offset should be -03:00 (the DST is supposed to not be active).

On which platforms did you notice this

[ ] macOS
[ ] Linux
[ ] Windows
[ ] iOS
[X] Android

Version Used:

Mono 6.6.0.155
Xamarin Android 10.1.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions