Module: Avro::LogicalTypes::TimestampMicros
- Defined in:
- lib/avro-patches/logical_types/logical_types.rb
Class Method Summary collapse
Class Method Details
.decode(int) ⇒ Object
35 36 37 38 |
# File 'lib/avro-patches/logical_types/logical_types.rb', line 35 def self.decode(int) s, us = int / 1000_000, int % 1000_000 Time.at(s, us).utc end |
.encode(value) ⇒ Object
30 31 32 33 |
# File 'lib/avro-patches/logical_types/logical_types.rb', line 30 def self.encode(value) time = value.to_time time.to_i * 1000_000 + time.usec end |