I want to map datetime in c# datetime in protobuf . Do you have any suggestion to do this?
I want to map datetime in c# datetime in protobuf . Do you have any suggestion to do this?
If you mean the Google implementation: quite simply, FromDateTime and ToDateTime
Google.Protobuf.WellKnownTypes.Timestamp protoTimestamp
= Google.Protobuf.WellKnownTypes.Timestamp.FromDateTime(DateTime.Now);
(I add that qualification because protobuf-net also defines similarly named types, which have implicit conversion operators to/from DateTime)