rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
25caa12d1d
commit
3f664b30fc
28
lib/time.rb
28
lib/time.rb
@ -252,6 +252,10 @@ class Time
|
|||||||
#
|
#
|
||||||
# A failure for Time.parse should be checked, though.
|
# A failure for Time.parse should be checked, though.
|
||||||
#
|
#
|
||||||
|
# time library should be required to use this method as follows.
|
||||||
|
#
|
||||||
|
# require 'time'
|
||||||
|
#
|
||||||
def parse(date, now=self.now)
|
def parse(date, now=self.now)
|
||||||
comp = !block_given?
|
comp = !block_given?
|
||||||
d = Date._parse(date, comp)
|
d = Date._parse(date, comp)
|
||||||
@ -293,6 +297,10 @@ class Time
|
|||||||
#
|
#
|
||||||
# See #rfc2822 for more information on this format.
|
# See #rfc2822 for more information on this format.
|
||||||
#
|
#
|
||||||
|
# time library should be required to use this method as follows.
|
||||||
|
#
|
||||||
|
# require 'time'
|
||||||
|
#
|
||||||
def rfc2822(date)
|
def rfc2822(date)
|
||||||
if /\A\s*
|
if /\A\s*
|
||||||
(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s*,\s*)?
|
(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s*,\s*)?
|
||||||
@ -342,6 +350,10 @@ class Time
|
|||||||
#
|
#
|
||||||
# See #httpdate for more information on this format.
|
# See #httpdate for more information on this format.
|
||||||
#
|
#
|
||||||
|
# time library should be required to use this method as follows.
|
||||||
|
#
|
||||||
|
# require 'time'
|
||||||
|
#
|
||||||
def httpdate(date)
|
def httpdate(date)
|
||||||
if /\A\s*
|
if /\A\s*
|
||||||
(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\x20
|
(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\x20
|
||||||
@ -389,6 +401,10 @@ class Time
|
|||||||
#
|
#
|
||||||
# See #xmlschema for more information on this format.
|
# See #xmlschema for more information on this format.
|
||||||
#
|
#
|
||||||
|
# time library should be required to use this method as follows.
|
||||||
|
#
|
||||||
|
# require 'time'
|
||||||
|
#
|
||||||
def xmlschema(date)
|
def xmlschema(date)
|
||||||
if /\A\s*
|
if /\A\s*
|
||||||
(-?\d+)-(\d\d)-(\d\d)
|
(-?\d+)-(\d\d)-(\d\d)
|
||||||
@ -431,6 +447,10 @@ class Time
|
|||||||
#
|
#
|
||||||
# If +self+ is a UTC time, -0000 is used as zone.
|
# If +self+ is a UTC time, -0000 is used as zone.
|
||||||
#
|
#
|
||||||
|
# time library should be required to use this method as follows.
|
||||||
|
#
|
||||||
|
# require 'time'
|
||||||
|
#
|
||||||
def rfc2822
|
def rfc2822
|
||||||
sprintf('%s, %02d %s %0*d %02d:%02d:%02d ',
|
sprintf('%s, %02d %s %0*d %02d:%02d:%02d ',
|
||||||
RFC2822_DAY_NAME[wday],
|
RFC2822_DAY_NAME[wday],
|
||||||
@ -462,6 +482,10 @@ class Time
|
|||||||
#
|
#
|
||||||
# Note that the result is always UTC (GMT).
|
# Note that the result is always UTC (GMT).
|
||||||
#
|
#
|
||||||
|
# time library should be required to use this method as follows.
|
||||||
|
#
|
||||||
|
# require 'time'
|
||||||
|
#
|
||||||
def httpdate
|
def httpdate
|
||||||
t = dup.utc
|
t = dup.utc
|
||||||
sprintf('%s, %02d %s %0*d %02d:%02d:%02d GMT',
|
sprintf('%s, %02d %s %0*d %02d:%02d:%02d GMT',
|
||||||
@ -484,6 +508,10 @@ class Time
|
|||||||
# +fractional_seconds+ specifies a number of digits of fractional seconds.
|
# +fractional_seconds+ specifies a number of digits of fractional seconds.
|
||||||
# Its default value is 0.
|
# Its default value is 0.
|
||||||
#
|
#
|
||||||
|
# time library should be required to use this method as follows.
|
||||||
|
#
|
||||||
|
# require 'time'
|
||||||
|
#
|
||||||
def xmlschema(fraction_digits=0)
|
def xmlschema(fraction_digits=0)
|
||||||
sprintf('%0*d-%02d-%02dT%02d:%02d:%02d',
|
sprintf('%0*d-%02d-%02dT%02d:%02d:%02d',
|
||||||
year < 0 ? 5 : 4, year, mon, day, hour, min, sec) +
|
year < 0 ? 5 : 4, year, mon, day, hour, min, sec) +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user