Fix generation of UTC times in spec

What does this MR do and why?

Ruby 3.0 allowed Time.utc('2022-01-02') even though it wasn't officially documented, but Ruby 3.1+ introduces stricter checking (https://github.com/ruby/ruby/blob/v3_1_4/NEWS.md). This commit fixes one test that was passing in a string instead of integers.

  • Time

    • Time.new now accepts optional in: keyword argument for the timezone, as well as Time.at and Time.now, so that is now you can omit minor arguments to Time.new. Feature 17485

      Time.new(2021, 12, 25, in: "+07:00")
      #=> 2021-12-25 00:00:00 +0700

      At the same time, time component strings are converted to integers more strictly now.

      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.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports

Loading