зеркало из https://github.com/github/ruby.git
[DOC] Include timezones document in timev.rb
So that it can be referred as a part of the document of `Time`.
This commit is contained in:
Родитель
c9c1670f7e
Коммит
ae3e9f114c
|
@ -1,5 +1,3 @@
|
|||
= Timezones
|
||||
|
||||
== Timezone Specifiers
|
||||
|
||||
Certain \Time methods accept arguments that specify timezones:
|
||||
|
@ -13,11 +11,11 @@ Certain \Time methods accept arguments that specify timezones:
|
|||
The value given with any of these must be one of the following
|
||||
(each detailed below):
|
||||
|
||||
- {Hours/minutes offset}[rdoc-ref:timezones.rdoc@Hours-2FMinutes+Offsets].
|
||||
- {Single-letter offset}[rdoc-ref:timezones.rdoc@Single-Letter+Offsets].
|
||||
- {Integer offset}[rdoc-ref:timezones.rdoc@Integer+Offsets].
|
||||
- {Timezone object}[rdoc-ref:timezones.rdoc@Timezone+Objects].
|
||||
- {Timezone name}[rdoc-ref:timezones.rdoc@Timezone+Names].
|
||||
- {Hours/minutes offset}[rdoc-ref:Time@Hours-2FMinutes+Offsets].
|
||||
- {Single-letter offset}[rdoc-ref:Time@Single-Letter+Offsets].
|
||||
- {Integer offset}[rdoc-ref:Time@Integer+Offsets].
|
||||
- {Timezone object}[rdoc-ref:Time@Timezone+Objects].
|
||||
- {Timezone name}[rdoc-ref:Time@Timezone+Names].
|
||||
|
||||
=== Hours/Minutes Offsets
|
||||
|
4
time.c
4
time.c
|
@ -4075,7 +4075,7 @@ time_zonelocal(VALUE time, VALUE off)
|
|||
* t.localtime("-09:00") # => 2000-01-01 11:15:01 -0900
|
||||
*
|
||||
* For forms of argument +zone+, see
|
||||
* {Timezone Specifiers}[rdoc-ref:timezones.rdoc].
|
||||
* {Timezone Specifiers}[rdoc-ref:Time@Timezone+Specifiers].
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -4176,7 +4176,7 @@ time_fixoff(VALUE time)
|
|||
* t.getlocal('+12:00') # => 2000-01-01 12:00:00 +1200
|
||||
*
|
||||
* For forms of argument +zone+, see
|
||||
* {Timezone Specifiers}[rdoc-ref:timezones.rdoc].
|
||||
* {Timezone Specifiers}[rdoc-ref:Time@Timezone+Specifiers].
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
12
timev.rb
12
timev.rb
|
@ -66,7 +66,7 @@
|
|||
#
|
||||
# Time.new(2002, 10, 31, 2, 2, 2, "+02:00") #=> 2002-10-31 02:02:02 +0200
|
||||
#
|
||||
# Or {a timezone object}[rdoc-ref:timezones.rdoc@Timezone+Objects]:
|
||||
# Or {a timezone object}[rdoc-ref:Time@Timezone+Objects]:
|
||||
#
|
||||
# zone = timezone("Europe/Athens") # Eastern European Time, UTC+2
|
||||
# Time.new(2002, 10, 31, 2, 2, 2, zone) #=> 2002-10-31 02:02:02 +0200
|
||||
|
@ -210,7 +210,9 @@
|
|||
# - #floor: Returns a new time with subseconds lowered to a floor.
|
||||
#
|
||||
# For the forms of argument +zone+, see
|
||||
# {Timezone Specifiers}[rdoc-ref:timezones.rdoc].
|
||||
# {Timezone Specifiers}[rdoc-ref:Time@Timezone+Specifiers].
|
||||
#
|
||||
# :include: doc/_timezones.rdoc
|
||||
class Time
|
||||
# Creates a new \Time object from the current system time.
|
||||
# This is the same as Time.new without arguments.
|
||||
|
@ -219,7 +221,7 @@ class Time
|
|||
# Time.now(in: '+04:00') # => 2009-06-24 07:39:54 +0400
|
||||
#
|
||||
# For forms of argument +zone+, see
|
||||
# {Timezone Specifiers}[rdoc-ref:timezones.rdoc].
|
||||
# {Timezone Specifiers}[rdoc-ref:Time@Timezone+Specifiers].
|
||||
def self.now(in: nil)
|
||||
Primitive.time_s_now(Primitive.arg!(:in))
|
||||
end
|
||||
|
@ -277,7 +279,7 @@ class Time
|
|||
# Time.at(secs, in: '-12:00') # => 2000-12-31 17:59:59 -1200
|
||||
#
|
||||
# For the forms of argument +zone+, see
|
||||
# {Timezone Specifiers}[rdoc-ref:timezones.rdoc].
|
||||
# {Timezone Specifiers}[rdoc-ref:Time@Timezone+Specifiers].
|
||||
#
|
||||
def self.at(time, subsec = false, unit = :microsecond, in: nil)
|
||||
if Primitive.mandatory_only?
|
||||
|
@ -371,7 +373,7 @@ class Time
|
|||
# When positional argument +zone+ or keyword argument +in:+ is given,
|
||||
# the new \Time object is in the specified timezone.
|
||||
# For the forms of argument +zone+, see
|
||||
# {Timezone Specifiers}[rdoc-ref:timezones.rdoc]:
|
||||
# {Timezone Specifiers}[rdoc-ref:Time@Timezone+Specifiers]:
|
||||
#
|
||||
# Time.new(2000, 1, 1, 0, 0, 0, '+12:00')
|
||||
# # => 2000-01-01 00:00:00 +1200
|
||||
|
|
Загрузка…
Ссылка в новой задаче