Bug 59358 - TimeZoneInfo.Local.DaylightName Doesn't Update
Summary: TimeZoneInfo.Local.DaylightName Doesn't Update
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: XI 10.12 (d15-3)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-08 19:14 UTC by ben.frye
Modified: 2017-10-02 16:19 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: No
Last known good build:


Attachments
Test App (14.80 KB, application/zip)
2017-09-11 14:48 UTC, ben.frye
Details

Description ben.frye 2017-09-08 19:14:56 UTC
Calling TimeZoneInfo.Local.DaylightName after changing the system time zone, while the app is open, does not get the updated system time zone. The attached sample app will showcase.

Steps to reproduce:
1. Launch app (on device, not simulator)
2. Click the + button
3. Note the console print statement (prints the time zone information)
4. Leave the app open, go to settings
5. Change the time zone information
6. Return to the app
7. Click the + button

Expected:
The new time zone is printed

Actual:
The time zone the system was set to when the app was launched is printed
Comment 1 ben.frye 2017-09-08 19:31:45 UTC
EDIT: Apparently I can't attach the test project because it's too large. All the test app is doing is `Console.WriteLine(TimeZoneInfo.Local.DaylightName);` when you hit a button. Should be easy enough to reproduce.
Comment 2 Manuel de la Peña 2017-09-11 10:58:22 UTC
Hello,

First, can you please provide the information of you environment? 

Easiest way to get exact version information:
- On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button.
- On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item.
Then copy/paste the version information (you can use the "Copy Information" button).


Also, it might be the case that the test app that you are trying to attach has the binaries in it and therefore is to large. Please try reattaching the application deleting the binaries (clean in Visual Studio or delete the bin and obj folders).
Comment 3 ben.frye 2017-09-11 14:48:13 UTC
Created attachment 24682 [details]
Test App
Comment 4 ben.frye 2017-09-11 14:49:04 UTC
Ok, I got the test app attached. Below is my version information:

=== Visual Studio Community 2017 for Mac ===

Version 7.1 (build 1297)
Installation UUID: 64e410ba-8ab8-4492-adc6-fa7610f61deb
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.Mac ===

Version: 3.6.0.19 (Visual Studio Community)

=== Xamarin.Android ===

Version: 7.4.0.21 (Visual Studio Community)
Android SDK: /Users/benfrye/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 26
SDK Build Tools Version: 25.0.1

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.iOS ===

Version: 10.12.0.20 (Visual Studio Community)
Hash: 80b8487d
Branch: d15-3
Build date: 2017-08-18 16:07:26-0400

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Comment 5 Manuel de la Peña 2017-09-12 23:18:53 UTC
Thanks for the info. Will test the app with the current stable and the comping Xcode 9 branch.
Comment 6 Manuel de la Peña 2017-09-28 10:31:53 UTC
This looks similar to bug 59596. In that bug, we are not getting the correct culture info, which, of course does affect the way the time zone info. Will be setting this bug as a duplicate of that bug, which is already in progress and being investigated.

*** This bug has been marked as a duplicate of bug 59596 ***
Comment 7 ben.frye 2017-09-28 14:44:03 UTC
Manuel, I don't believe this is a duplicate of that bug. This bug has nothing to do with changing the device's culture nor region. This is when the time zone specifically is changed. As noted, closing and restarting the app acquires the correct info, so again it's not that it is ALWAYS getting the wrong info. It is merely if the time zone has been changed while the app is running. This is also not an iOS bug, as the bug 59596 seems to claim. This is only reproducible with Xamarin.iOS and not if you attempt to reproduce with a native iOS app.
Comment 8 Manuel de la Peña 2017-09-29 11:43:14 UTC
I miss understood the bug. The issue is that the CultureInfo (for dates etc..) is not dynamically changed while the app is running after the settings have been changed. Is this correct?
Comment 9 ben.frye 2017-09-29 14:23:42 UTC
Not the culture info, the TimeZoneInfo. `TimeZoneInfo.Local.DaylightName`
Comment 10 Manuel de la Peña 2017-09-29 14:35:21 UTC
Ok, et me double check that.

Note You need to log in before you can comment on or make changes to this bug.