# XMLRPC::DateTime (Class)

In: | xmlrpc/datetime.rb
Parent: | Object

## Methods

day= hour= min= mon= month= new sec= to_a to_date to_time year=

## External Aliases

month -> mon

## Attributes

day | [R] |
hour | [R] |
min | [R] |
month | [R] |
sec | [R] |
year | [R] |

## Public Class methods

new(year, month, day, hour, min, sec)

[Source]

    # File xmlrpc/datetime.rb, line 108
      def initialize(year, month, day, hour, min, sec)
        self.year, self.month, self.day = year, month, day
        self.hour, self.min, self.sec   = hour, min, sec
      end

## Public Instance methods

year=(value)

[Source]

    # File xmlrpc/datetime.rb, line 74
      def year= (value)
        raise ArgumentError, "date/time out of range" unless value.is_a? Integer
        @year = value
      end

month=(value)

[Source]

    # File xmlrpc/datetime.rb, line 79
      def month= (value)
        raise ArgumentError, "date/time out of range" unless (1..12).include? value
        @month = value
      end

day=(value)

[Source]

    # File xmlrpc/datetime.rb, line 84
      def day= (value)
        raise ArgumentError, "date/time out of range" unless (1..31).include? value
        @day = value
      end

hour=(value)

[Source]

    # File xmlrpc/datetime.rb, line 89
      def hour= (value)
        raise ArgumentError, "date/time out of range" unless (0..24).include? value
        @hour = value
      end

min=(value)

[Source]

    # File xmlrpc/datetime.rb, line 94
      def min= (value)
        raise ArgumentError, "date/time out of range" unless (0..59).include? value
        @min = value
      end

sec=(value)

[Source]

    # File xmlrpc/datetime.rb, line 99
      def sec= (value)
        raise ArgumentError, "date/time out of range" unless (0..59).include? value
        @sec = value
      end

mon=(value)

Alias for month=

to_time()

[Source]

    # File xmlrpc/datetime.rb, line 113
      def to_time
        if @year >= 1970
          Time.gm(*to_a)
        else
          nil
        end
      end

to_date()

[Source]

    # File xmlrpc/datetime.rb, line 121
      def to_date
        Date.new(*to_a[0,3])
      end

to_a()

[Source]

    # File xmlrpc/datetime.rb, line 125
      def to_a
        [@year, @month, @day, @hour, @min, @sec]
      end

[Validate]