Class: DateTime

Inherits:
Object
  • Object
show all
Defined in:
lib/axiom/sql/generator/core_ext/date_time.rb

Overview

Extend DateTime with methods available in ruby 1.9

Constant Summary collapse

SEC_FRACTION_MULTIPLIER =

TODO: remove the rbx guard when fractional seconds are handled properly in 1.9 mode

RUBY_VERSION < '1.9' ? 60 * 60 * 24 : 1

Instance Method Summary collapse

Instance Method Details

#iso8601(time_scale = 0) ⇒ #to_s

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

TODO:

Remove once backports adds this method

Return the DateTime in ISO8601 date-time format

Parameters:

  • time_scale (Integer) (defaults to: 0)

    the number of significant digits to use for fractional seconds

Returns:

  • (#to_s)


19
20
21
# File 'lib/axiom/sql/generator/core_ext/date_time.rb', line 19

def iso8601(time_scale = 0)
  super() + iso8601_timediv(time_scale)
end