Closed physhi closed 7 years ago
You need to use
NetJSONSetting.DateStringFormat = default: Null
It allows you to customize the serialization and deserialization of custom dates.
The problem is not really with just default(DateTime) but also with default(DateTime).AddMinutes(1).
But I guess, I should use different dateTime serialization as they will be much faster than string serializations (the main reason of using NetJson is speed).
Anyways, great work, with the speed. Even though the code is a bit complex (you are literally working with IL and it becomes hard to follow, but I guess that's the only way to gurantee performance).
On Sun, Apr 23, 2017 at 5:15 PM, Rpgmaker notifications@github.com wrote:
You need to use
NetJSONSetting.DateStringFormat = default: Null
- This allows customization of date formatting and ignore other formatting option when specified.
It allows you to customize the serialization and deserialization of custom dates.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rpgmaker/NetJSON/issues/162#issuecomment-296499368, or mute the thread https://github.com/notifications/unsubscribe-auth/AGsTgXpPACEaEDLFn74rKoWqgsPH1b8sks5ry-mXgaJpZM4NFlf0 .
Thanks 😀. Working with IL does not guaranteed speed. It is what it generate that does and the unsafe code implementation.
Do you think you can close this issue since you are using the standard date serialization?
Thanks,
Closing this issue. Open if still needed
The problem is that the format of the date in text is "1-01-01 00:00:00.0". The code assumes that the year portion will be 4 characters.
Test case NetJson.DeSerialize(NetJson.Serialize(default(DateTime))