# encoding: utf-8

module Axiom
  module Types

    # Represents a date time type
    class DateTime < Object
      extend ValueComparable

      # Maximum number of seconds and fractional seconds
      MAXIMUM_SECONDS = 60 - Rational(1, 10**9)

      primitive       ::DateTime
      coercion_method :to_datetime

      minimum primitive.new(1, 1, 1)
      maximum primitive.new(9999, 12, 31, 23, 59, MAXIMUM_SECONDS)

    end # class DateTime
  end # module Types
end # module Axiom

# encoding: utf-8

module Axiom
  module Types

    # Represents a date time type
    class DateTime < Object
      extend ValueComparable

      # The maximum seconds and fractional seconds for DateTime
      MAXIMUM_SECONDS = 60 - Rational(1, 10**12)

      primitive       ::DateTime
      coercion_method :to_datetime

      minimum primitive.new(1, 1, 1)
      maximum primitive.new(9999, 12, 31, 23, 59, MAXIMUM_SECONDS)

    end # class DateTime
  end # module Types
end # module Axiom

Change DateTime fractional seconds to be picoseconds
Change DateTime fractional seconds to be picoseconds
