1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

NEWS: mention Time.new argument error more

Show an example of Time.new with perhaps unexpected results in
earlier versions.
This commit is contained in:
Nobuyoshi Nakada 2021-12-25 18:24:39 +09:00
parent 975a6efd7e
commit 14e550052b
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -276,10 +276,14 @@ Note: We're only listing outstanding class updates.
integers more strictly now.
```ruby
Time.new(2021, 12, 25, "+07:00")
#=> invalid value for Integer(): "+07:00" (ArgumentError)
Time.new(2021, 12, 25, "+07:30")
#=> invalid value for Integer(): "+07:30" (ArgumentError)
```
Ruby 3.0 or earlier returned probably unexpected result
`2021-12-25 07:00:00`, not `2021-12-25 07:30:00` nor
`2021-12-25 00:00:00 +07:30`.
* Time#strftime supports RFC 3339 UTC for unknown offset local
time, `-0000`, as `%-z`. [[Feature #17544]]