summaryrefslogtreecommitdiff
path: root/timev.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-17 21:50:40 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-17 21:52:50 +0900
commita145a204ec01a5087a3d3699e3707b41afd5fd6b (patch)
tree59ffae11617f24f2f2efddc6429577779fe067fb /timev.rb
parent7b1d23fd295fe8275b313f31ea545f7f6b3f2e62 (diff)
downloadruby-a145a204ec01a5087a3d3699e3707b41afd5fd6b.tar.gz
[DOC] Update about `sec` argument of `Time.new`
Diffstat (limited to 'timev.rb')
-rw-r--r--timev.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/timev.rb b/timev.rb
index a2a8bb3cb1..6bfb4e5e1b 100644
--- a/timev.rb
+++ b/timev.rb
@@ -330,12 +330,17 @@ class Time
# Time.new(2000, 1, 1, 0, 0) # => 2000-01-01 00:00:00 -0600
# Time.new(2000, 1, 1, 0, 59) # => 2000-01-01 00:59:00 -0600
#
- # - +sec+: Second in range (0..59), or 60 if +usec+ is zero:
+ # - +sec+: Second in range (0...61):
#
# Time.new(2000, 1, 1, 0, 0, 0) # => 2000-01-01 00:00:00 -0600
# Time.new(2000, 1, 1, 0, 0, 59) # => 2000-01-01 00:00:59 -0600
# Time.new(2000, 1, 1, 0, 0, 60) # => 2000-01-01 00:01:00 -0600
#
+ # +sec+ may be Float or Rational.
+ #
+ # Time.new(2000, 1, 1, 0, 0, 59.5) # => 2000-12-31 23:59:59.5 +0900
+ # Time.new(2000, 1, 1, 0, 0, 59.7r) # => 2000-12-31 23:59:59.7 +0900
+ #
# These values may be:
#
# - Integers, as above.