Closed saiganesh-sakthivel closed 1 year ago
I highly doubt this has something to do with Xamarin.Forms. Try to create a Xamarin.Android and UWP project without Forms and see if it has the same behavior. If it does, it might be something for the Xamarin.Android team or even the runtime team.
Description
[Bug] TimeZoneInfo convert time is not updated correctly for Jordan Standard Time. It differ for the iOS and other platforms (Android, UWP). In android and UWP the TimeZoneInfo.ConvertTime() from UTC to Jordan returns +2 hrs but iOS returns +3hrs.
Code Snippet public MainPage() { InitializeComponent(); var newdate = new DateTime(2018, 03, 25, 09, 0, 0); UTCTime.Text = newdate.ToString(); var timeZone = TimeZoneInfo.FindSystemTimeZoneById(GetTimeZone()); var jordandate = TimeZoneInfo.ConvertTime(newdate, TimeZoneInfo.Utc, timeZone); JordanTime.Text = jordandate.ToString(); }
string GetTimeZone() { switch (Device.RuntimePlatform) { case Device.UWP: return "Jordan Standard Time"; default: return "Asia/Amman"; } }
Steps to Reproduce
Expected Behavior
It should returns +3hrs as per the world time. https://www.timeanddate.com/time/zone/jordan
Actual Behavior
Android and UWP returns +2hrs
Basic Information
Environment
Show/Hide Visual Studio info
``` ```Build Logs
Screenshots
UWP![ScheduleXamarin UWP 3_13_2023 6_40_54 PM](https://user-images.githubusercontent.com/61176526/224713272-dff421a8-a054-41ea-a212-07497fc96fc0.png)
iOS![Simulator Screen Shot - iPhone 8 - 2023-03-13 at 12 55 26](https://user-images.githubusercontent.com/61176526/224713830-e81fcedd-0b35-4d50-b5f5-186dc57a203d.png)
Reproduction Link
ScheduleXamarin.zip
Workaround