0001-Added-documentation-for-Date-formats.patch

Clinton Nixon, 05/20/2011 04:42 AM

Download (1.89 KB)

View differences:

ext/date/lib/date/format.rb
110 110

  
111 111
  end
112 112

  
113
  # Returns a String representing this Date in the form:
114
  # Sun Sep 30 00:00:00 1977.
113 115
  def asctime() strftime('%c') end
114 116

  
115 117
  alias_method :ctime, :asctime
116 118

  
119
  # Returns a String representing this Date in the form:
120
  # 1977-09-30.
121
  #
122
  # This form is in accordance with
123
  # ISO8601[http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/date_and_time_format.htm].
117 124
  def iso8601() strftime('%F') end
118 125

  
126
  # Returns a String representing this Date in the form:
127
  # 1977-09-30T00:00:00+00:00
128
  #
129
  # This form is in accordance with the format for a timestamp in
130
  # RFC3339[http://www.ietf.org/rfc/rfc3339.txt].
119 131
  def rfc3339() strftime('%FT%T%:z') end
120 132

  
133
  # Synonym for Date.iso8601.
121 134
  def xmlschema() iso8601 end # :nodoc:
122 135

  
136
  # Returns a String representing this Date in the form:
137
  # Fri, 30 Sep 1977 00:00:00 +0000
138
  #
139
  # This form is in accordance with the format for a full
140
  # date and time specification in
141
  # RFC2822[http://www.ietf.org/rfc/rfc2822.txt].
123 142
  def rfc2822() strftime('%a, %-d %b %Y %T %z') end
124 143

  
125 144
  alias_method :rfc822, :rfc2822
126 145

  
127 146
  def httpdate() new_offset(0).strftime('%a, %d %b %Y %T GMT') end # :nodoc:
128 147

  
148
  # Returns a String representing this Date in a form
149
  # that is in accordance with the Japanese specification
150
  # JIS X 0301.
129 151
  def jisx0301
130 152
    if jd < 2405160
131 153
      strftime('%F')
132
-