Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the .proto message for datetime in protobuf-net

Tags:

protobuf-net

I am trying to write some code that will generate accurate .proto files from the protobuf-net (V2) runtime type model, so I can write a python client capable of deserializing protobuf-net generated messages.

I am a little bit stuck on what the messages should look like for datetime though, can anyone shed some light on this?

Thanks <3

like image 317
Franchesca Avatar asked Jun 14 '12 07:06

Franchesca


1 Answers

The core protobuf spec has no inbuilt mechanism for handling dates/times.

If you are working between platforms, then frankly I would suggest exposing it in a more simpler manner, such as a long (unix time, or similar). protobuf-net uses a bit of a more granular layout, to exploit the fact that many many datetime values are pure dates, etc. There was a BCL.proto on the project site, but I can't seem to find it right now... that is odd (I will investigate). However: if the option is available: just expose the data in a simpler manner.

like image 159
Marc Gravell Avatar answered Oct 13 '22 00:10

Marc Gravell