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
Incorrect DateTime.Now for Casablanca (Marocco) TimeZone #21177
Comments
Related issue #20510 |
Relatedly, there were some issues like tzinfo/tzinfo#98 and tzinfo/tzinfo#123 seem to point to something funny in the 2018e tzdata database tzinfo/tzinfo@246d5ba We might need similar changes in our parsing code, assuming something similar is going on and that the data on iphones has the updated timezone info for Casablanca. |
cc @eerhardt just in case he is familiar with issues there. |
One issue I know of is: dotnet/runtime#31331 (comment). In this case we were throwing an exception when parsing the TZ file, and thus turning off DST, which is obviously not going to produce the correct time when in daylight savings time. |
Thanks @eerhardt that was super-helpful! Comparing the mono/mono parsing logic and what's in dotnet/runtime, it looks like mono/mono only reads the V1 tzfile data (which is probably incomplete or only covers a limited time period - I haven't checked the contents yet). |
Team, |
No update. @mandel-macaque is there an iOS API that can be used to get the time that could be used instead of |
I'm curious, if you try .NET MAUI, do you get the correct time? |
Original source of this issues is from a feedback ticket that was added to Xamarin.iOS yet we do not implemente the TZ code and we use the bcl. The original source is https://developercommunity.visualstudio.com/t/Incorrect-DateTimeNow-for-Casablanca-M/1476956
[severity:I’m unable to use this version]
We are the developing the mobile application using xamarin forms and we are calling DateTime.Now in several places of the app to get the current date time. But DateTime.Now is returning the wrong Date Time, if we set the timezone of the IPad to Marocco,Casablanca.
Example.
if device time is 2PM(this can be verified in settings app of Ipad/in the status bar) then in the app we see 1PM but it should be 2PM.
Repro steps:
1.Open Settings app in Ipad/Iphone and search for date time.
2.Select date time and change the time zone to Marocco,Casablanca.
3.Call DateTime.Now in the Xamarin forms app and observe the date Time returned.
Issue: DateTime.Now is returning wrong time(ex. if device time is 2PM it returns 1PM).
expected Result:DateTime.Now should return the value which should match with device datetime
FYI:
This is blocking us from rolling out app to our client who are using Marocco,Casablanca time zone.
We are expecting fix for this issue or we need a work around to overcome this issue.
The text was updated successfully, but these errors were encountered: