mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 05:29:10 +02:00

`Time.new` now parses strings such as the result of `Time#inspect` and restricted ISO-8601 formats.
10 lines
293 B
YAML
10 lines
293 B
YAML
prelude: |
|
|
require 'time'
|
|
inspect = "2021-08-23 09:57:02 +0900"
|
|
iso8601 = "2021-08-23T09:57:02+09:00"
|
|
benchmark:
|
|
- Time.iso8601(iso8601)
|
|
- Time.parse(iso8601)
|
|
- Time.parse(inspect)
|
|
- Time.new(iso8601) rescue Time.iso8601(iso8601)
|
|
- Time.new(inspect) rescue Time.parse(inspect)
|