123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Criteria::Queryable::Extensions::DateTime

Relationships & Source Files
Namespace Children
Modules:
Defined in: lib/mongoid/criteria/queryable/extensions/date_time.rb

Overview

Adds query type-casting behavior to DateTime class.

Instance Method Summary

Instance Method Details

#__evolve_time__Time

Evolve the date time into a mongo friendly UTC time.

Examples:

Evolve the date time.

date_time.__evolve_time__

Returns:

  • (Time)

    The converted time in UTC.

[ GitHub ]

  
# 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