Surreal-Net / Surreal.Net

Database driver for SurrealDB available for REST and RPC sessions.
Apache License 2.0
57 stars 7 forks source link

Bug: DateTimes are not inserted into the database correctly #25

Closed Du-z closed 2 years ago

Du-z commented 2 years ago

DateTimes do not survive a roundtrip.

They seem to be inserted with two zeros prepended to the fractions part of the time. "MaxUtcDateTime": "9999-12-31T23:59:59.009999999Z"

Uncomment the following line and run the test RpcRoundTripTests.CreateRoundTripTest

https://github.com/ProphetLamb/Surreal.Net/blob/3ed84b191f60a98dd82837beec744d3e71129ae6/tests/Core.Tests/RoundTripTests.cs#L165

ProphetLamb commented 2 years ago

According to ISO 8601 the fraction can be fixed

Time, with optional fractional seconds and time zone (e.g., 01:45:36 or 01:45:36.123+07:00). There is no limit on the number of digits for the fractional seconds.

ProphetLamb commented 2 years ago

Wired that Surreal cannot handle that, because the chrono package can iirc

tobiemh commented 2 years ago

@ProphetLamb the parsing isn't done with chrono, albeit we do use chrono for datetimes.

ProphetLamb commented 2 years ago

Fixed with #26