-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deerialize utc-time different from the original field utc-time #134
Comments
Is the year, month, day...seconds the same? |
Yes. but the hour is different. |
If you add the following: Console.WriteLine(m.LogUtcTime);
Console.WriteLine(gBack.LogUtcTime); You will get :
Which shows the dates are the same, however the objects will not be since the nano seconds are not set on the deserialized dates, hence your condition will fail. |
My results
|
Try testing @12:00 noon |
also var jsonText = fastJSON.JSON.ToJSON(model, new JSONParameters { UseUTCDateTime =true});
var gBack = fastJSON.JSON.ToObject<Model>(jsonText , new JSONParameters { UseUTCDateTime=true}); |
Thanks @mgholam Full source codes: namespace TestCode
} |
For a simple Object with DateTime field, assign UTC-Time to it and serialize the object to json-text, then deserialize an object from the same json-text, the UTC-Time does not match with the original value (your time zone should not be UTC to reproduce the bug).
Code Example:
public class MUtcTime
{
public long ID { get; set; }
public DateTime LogUtcTime { get; set; }
}
The text was updated successfully, but these errors were encountered: