Module: OEHClient::Helper::Timestamp
- Defined in:
- lib/oehclient/helper.rb
Class Method Summary collapse
-
.to_one_timestamp(timevalue) ⇒ Object
convert the time value from a Time, DateTime, String, or Integer to a proper ONE timestamp value format (UTC Milliseconds).
Class Method Details
.to_one_timestamp(timevalue) ⇒ Object
convert the time value from a Time, DateTime, String, or Integer to a proper ONE timestamp value format (UTC Milliseconds)
83 84 85 86 87 88 89 90 91 |
# File 'lib/oehclient/helper.rb', line 83 def self.(timevalue) = timevalue if (timevalue.is_a?(Integer)) = timevalue.utc.strftime("%s%L").to_i if (timevalue.is_a?(Time) || timevalue.is_a?(DateTime)) = Time.parse(timevalue).utc.strftime("%s%L").to_i if (timevalue.is_a?(String)) end |