Regd: How do I represent java.util.Date in my .proto definition?

379 views
Skip to first unread message

rahul prasad

unread,
Nov 10, 2009, 3:25:11 PM11/10/09
to Protocol Buffers
How do I represent java.util.Date in my .proto definition? Is this supported, or any other workaround for doing this?

Regards,
Rahul Prasad

Dan

unread,
Nov 10, 2009, 7:44:13 PM11/10/09
to Protocol Buffers
I use a dateFormatter to send it as a string. I suppose its also
possible to send it as a int64 if you want. Just be wary of
timezones.

Dan

Jon Skeet

unread,
Nov 11, 2009, 7:42:48 AM11/11/09
to Protocol Buffers
A java.util.Date doesn't contain a timezone anyway - it's always UTC.

I've previous suggested (but made no progress on) a set of "common"
protocol buffer messages which could be used for various products,
with helper libraries for popular platforms providing conversions
between the messages and more idiomatic types (e.g. Date on Java,
DateTime/DateTimeOffset on .NET).

Jon
Reply all
Reply to author
Forward
0 new messages