google-protos
google-protos copied to clipboard
Elixir files generated from Google's protobuf files using protobuf-elixir
Google Protos
For Elixir files generated from Google's protobuf files using protobuf-elixir.
How-To
Convert Google.Protobuf.Timestamp to DateTime
- Convert timestamp seconds to nanoseconds.
- Add the timestamp nanos.
- Convert to
DateTimeusingDateTime.from_unix!/2.
timestamp = Google.Protobuf.Timestamp.new(seconds: 5, nanos: 100)
DateTime.from_unix!(timestamp.seconds * 1_000_000_000 + timestamp.nanos, :nanosecond)