There are the well-known types
<https://developers.google.com/protocol-buffers/docs/reference/google.protobuf>,
which include google.protobuf.Timestamp:
syntax = "proto3";
import "google/protobuf/timestamp.proto";
message Product {
google.protobuf.Timestamp last_ordered_date = 1;
}
Sadly, the documentation for each type (in the link above) does not tell
you the import path to use it. All of them are in the google.protobuf
package and the files are all imported from google/protobuf/*.proto. These
files are included with protoc, so you can find their sources in your
protobuf installation and also in the repo
<https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto>
.
----
*Josh Humphries*
[email protected]
On Fri, Jan 18, 2019 at 12:27 PM Shilpa Vittal <[email protected]> wrote:
> HI,
>
> I have a Date java object that I want to add in .proto file. I use Proto3.
> Is there any exisitng proto Datatype that I can use?
> Please advise at the earliest.
>
> Ex:
>
> message Product{
>
> optional date last_ordered_date = 1;
> }
>
> where last_ordered_date='2019-01-15'
>
> Thanks,
> Shilpa
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.