Skip to content

Commit b17f984

Browse files
committed
[doc] Time class document updated.
1 parent 4963d39 commit b17f984

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

timev.rb

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,38 @@
4747
#
4848
# == \Time Internal Representation
4949
#
50-
# Time implementation uses a signed 63 bit integer, Integer, or
51-
# Rational.
52-
# It is a number of nanoseconds since the _Epoch_.
50+
# Conceptually, Time class uses a Rational value to represent the number of
51+
# nanoseconds from _Epoch_, 1970-01-01 00:00:00 UTC.
52+
# There are no boundary or resolution limitations.
53+
# The value can be obtaind using Time#to_r.
54+
#
55+
# The Time class always uses the Gregorian calendar.
56+
# I.e. the proleptic Gregorian calendar is used.
57+
# Other calendars, such as Julian calendar, are not supported.
58+
#
59+
# The implementation uses a signed 63 bit integer or Integer (Bignum) to
60+
# represent the Rational values if possible.
61+
# (The signed 63 bit integers are used regardless of 32 and 64 bit environments.)
5362
# The signed 63 bit integer can represent 1823-11-12 to 2116-02-20.
5463
# When Integer or Rational is used (before 1823, after 2116, under
5564
# nanosecond), Time works slower than when the signed 63 bit integer is used.
5665
#
5766
# Ruby uses the C function +localtime+ and +gmtime+ to map between the number
5867
# and 6-tuple (year,month,day,hour,minute,second).
59-
# +localtime+ is used for local time and "gmtime" is used for UTC.
68+
# +localtime+ is used for local time and +gmtime+ is used for UTC.
6069
#
6170
# Integer and Rational has no range limit, but the localtime and
6271
# gmtime has range limits due to the C types +time_t+ and <tt>struct tm</tt>.
6372
# If that limit is exceeded, Ruby extrapolates the localtime function.
6473
#
65-
# The Time class always uses the Gregorian calendar.
66-
# I.e. the proleptic Gregorian calendar is used.
67-
# Other calendars, such as Julian calendar, are not supported.
68-
#
6974
# +time_t+ can represent 1901-12-14 to 2038-01-19 if it is 32 bit signed integer,
7075
# -292277022657-01-27 to 292277026596-12-05 if it is 64 bit signed integer.
7176
# However +localtime+ on some platforms doesn't supports negative +time_t+ (before 1970).
7277
#
7378
# <tt>struct tm</tt> has _tm_year_ member to represent years.
7479
# (<tt>tm_year = 0</tt> means the year 1900.)
7580
# It is defined as +int+ in the C standard.
76-
# _tm_year_ can represent between -2147481748 to 2147485547 if +int+ is 32 bit.
81+
# _tm_year_ can represent years between -2147481748 to 2147485547 if +int+ is 32 bit.
7782
#
7883
# Ruby supports leap seconds as far as if the C function +localtime+ and
7984
# +gmtime+ supports it.

0 commit comments

Comments
 (0)