Method: Mongoid::Extensions::Array#__mongoize_time__

Defined in:
lib/mongoid/extensions/array.rb

#__mongoize_time__Time | ActiveSupport::TimeWithZone

Note:

Returns a local time in the default time zone.

Converts the array for storing as a time.

Examples:

Convert the array to a time.

[ 2010, 1, 1 ].__mongoize_time__
# => 2010-01-01 00:00:00 -0500

Returns:

  • (Time | ActiveSupport::TimeWithZone)

    Local time in the configured default time zone corresponding to date/time components in this array.



54
55
56
# File 'lib/mongoid/extensions/array.rb', line 54

def __mongoize_time__
  ::Time.zone.local(*self)
end