summaryrefslogtreecommitdiff
path: root/timev.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-11-24 19:16:18 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-11-24 19:38:55 +0900
commit2ecc372a5d623ff4e470c354c771f8797e527c2d (patch)
treeba03610944a72fb9308a8f9e0f4166726b7b0854 /timev.rb
parent045e74d8e484bca963eba6210d85222fa9362615 (diff)
[DOC] State timezone info in the string wins `in:` keyword
Diffstat (limited to 'timev.rb')
-rw-r--r--timev.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/timev.rb b/timev.rb
index 28e0a444b1..db3a1925ce 100644
--- a/timev.rb
+++ b/timev.rb
@@ -380,6 +380,12 @@ class Time
# Time.new(in: '-12:00')
# # => 2022-08-23 08:49:26.1941467 -1200
#
+ # Since +in:+ keyword argument just provides the default, so if the
+ # first argument in single string form contains time zone information,
+ # this keyword argument will be silently ignored.
+ #
+ # Time.new('2000-01-01 00:00:00 +0100', in: '-0500').utc_offset # => 3600
+ #
# - +precision+: maximum effective digits in sub-second part, default is 9.
# More digits will be truncated, as other operations of \Time.
# Ignored unless the first argument is a string.