jamesmontemagno / SettingsPlugin

Read and Write Settings Plugin for Xamarin and Windows
MIT License
324 stars 80 forks source link

DateTime object gets wrong value #146

Closed grammatnMcK closed 5 years ago

grammatnMcK commented 5 years ago

Failure to fill out this information will result in this issue being closed.

If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below.

If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here.

Bug Information

Version Number of Plugin: 3.1.1 Simulator Tested On: iPhone 8 Version of VS: 7.7.2 Build 21 Version of Xamarin: Xamarin Forms 3.4.0 Versions of other things you are using:

Steps to reproduce the Behavior

Save to an object of the settings the DateTime.Now: _settingsService.LastAppOpened = DateTime.Now;

Expected Behavior

LastAppOpened has the same value with the DateTime.Now

Actual Behavior

LastAppOpened is one hour earlier.

Screenshots

screenshot 2019-01-16 at 18 21 24

jamesmontemagno commented 5 years ago

It always saves your value as UTC

grammatnMcK commented 5 years ago

and why don't you just get the given value? What's is the point to do something in the code behind that is not wanted? Is there any chance to change it?

jamesmontemagno commented 5 years ago

It is well documented here: https://jamesmontemagno.github.io/SettingsPlugin/GettingStarted.html additionally a long thread can be found: https://github.com/jamesmontemagno/Xamarin.Plugins/pull/107