Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/date_time_precision/format/hash.rb
Constant Summary collapse
- DATE_FORMATS =
{ :short => [:y, :m, :d, :h, :min, :s, :sec_frac], :long => [:year, :month, :day, :hour, :minute, :second, :second_fraction], :ruby => [:year, :mon, :day, :hour, :min, :sec, :sec_frac] }
Instance Method Summary collapse
Instance Method Details
#to_date ⇒ Object
19 20 21 |
# File 'lib/date_time_precision/format/hash.rb', line 19 def to_date Date.new(*date_time_args.take(Date::MAX_PRECISION)) end |
#to_datetime ⇒ Object
15 16 17 |
# File 'lib/date_time_precision/format/hash.rb', line 15 def to_datetime DateTime.new(*date_time_args.take(DateTime::MAX_PRECISION)) end |