c# - Saving a DateTime value to Local Settings [UWP] -
in uwp app i'm trying save datetime value local settings code:
localsettings.values["date"] = mydate;
the problem when try retrieve value cast error. i'm using code retrieve value:
datetime daterecovered = (datetime)localsettings.values["date"];
you can refer official documentation here
the supported type date system.datetimeoffset
, not system.datetime
. so, can modify code this:
applicationdata.current.localsettings.values["date"] = datetimeoffset.utcnow;
Comments
Post a Comment