Module: Origin::Extensions::DateTime
- Defined in:
- lib/origin/extensions/date_time.rb
Overview
This module contains additional datetime behaviour.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#__evolve_time__ ⇒ Time
Evolve the date time into a mongo friendly UTC time.
Instance Method Details
#__evolve_time__ ⇒ Time
Evolve the date time into a mongo friendly UTC time.
16 17 18 19 20 21 22 23 |
# File 'lib/origin/extensions/date_time.rb', line 16 def __evolve_time__ usec = strftime("%6N").to_f if utc? ::Time.utc(year, month, day, hour, min, sec, usec) else ::Time.local(year, month, day, hour, min, sec, usec).utc end end |