Module: BSON::LogStashTimestamp::ClassMethods
- Defined in:
- lib/logstash/outputs/bson/logstash_timestamp.rb
Instance Method Summary collapse
-
#from_bson(bson) ⇒ ::LogStash::Timestamp
Deserialize UTC time from BSON.
Instance Method Details
#from_bson(bson) ⇒ ::LogStash::Timestamp
Deserialize UTC time from BSON.
37 38 39 40 |
# File 'lib/logstash/outputs/bson/logstash_timestamp.rb', line 37 def from_bson(bson) seconds, fragment = BSON::Int64.from_bson(bson).divmod(1000) new(::Time.at(seconds, fragment * 1000).utc) end |