Module: Mongoid::Criteria::Queryable::Extensions::DateTime
- Defined in:
- lib/mongoid/criteria/queryable/extensions/date_time.rb
Overview
Adds query type-casting behavior to DateTime class.
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.
18 19 20 21 22 |
# File 'lib/mongoid/criteria/queryable/extensions/date_time.rb', line 18 def __evolve_time__ usec = strftime("%6N").to_f u = utc ::Time.utc(u.year, u.month, u.day, u.hour, u.min, u.sec, usec) end |