You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading back a DateTimewith kind Unspecified and ForcedDateTimeKind = DateTimeKind.Unspecified, the resulting date has kind Utc and has has been converted to UTC which is unexpected.
Step to reproduce
Run this code:
using Akavache;
using System.Reactive.Linq;
BlobCache.ForcedDateTimeKind = DateTimeKind.Unspecified;
BlobCache.ApplicationName = "myapp";
BlobCache.EnsureInitialized();
var testDate = new DateTime(2024, 10, 10, 10, 10, 0, 0, DateTimeKind.Unspecified);
await BlobCache.LocalMachine.InsertObject("test", testDate);
var readBack = await BlobCache.LocalMachine.GetObject<DateTime>("test");
Console.WriteLine(testDate.ToLongTimeString() + ", " + testDate.Kind);
Console.WriteLine(readBack.ToLongTimeString() + ", " + readBack.Kind);
Currently having this issue, we get a json from an API, convert into an object, and store that in this dataservice. The received date is ex 10:36:40, and the second time we get the data, it gets retrieved from the BlobCache, it gets returned as 08:36:40. Tried all the various ForcedDateTimeKind settings.
Describe the bug 🐞
When reading back a
DateTime
with kindUnspecified
andForcedDateTimeKind = DateTimeKind.Unspecified
, the resulting date has kindUtc
and has has been converted to UTC which is unexpected.Step to reproduce
Run this code:
Reproduction repository
https://github.com/reactiveui/ReactiveUI
Expected behavior
The date that is read from the cache should be the same (same value and kind) as the one that is inserted.
Screenshots 🖼️
IDE
No response
Operating system
MacOS, iOS
Version
10.0.1
Device
No response
ReactiveUI Version
No response
Additional information ℹ️
No response
The text was updated successfully, but these errors were encountered: