Skip to content
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

Datetime in inner class become '0001-01-01T00:00:00' #35

Open
lyk2016 opened this issue Nov 7, 2024 · 0 comments
Open

Datetime in inner class become '0001-01-01T00:00:00' #35

lyk2016 opened this issue Nov 7, 2024 · 0 comments

Comments

@lyk2016
Copy link

lyk2016 commented Nov 7, 2024

'date' become '0001-01-01T00:00:00' when use below code

private class TestClass
{
    public TestDate Date1 { get; set; }
}
private class TestDate
{
    public DateTime date;
}

private static Serializer serializer_ = new Serializer(new PropertiesExtractor(), options: GroBufOptions.WriteEmptyObjects);
TestClass cls = new TestClass() { Date1 = new TestDate() { date = DateTime.Now } };
byte[] data = serializer_.Serialize(cls);
var q = serializer_.Deserialize<TestClass>(data);//q.Date1.date become '0001-01-01T00:00:00'

I appreciate your help.
lyk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant