Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The case of
DateTimeType.parse("00:00+1000")
is parsed by Time.parse in DSL.try_parse_time_like, which takes into account the current time and the system time zone in interpreting the given "time+timezone" string.This is why it has been intermittent in the past: depending on the time the spec was running, and the system time zone of the machine running the spec, the resulting date could be either today or yesterday whereas the previous spec was pinning the date to today's date.
Here's a demonstration, notice the date in the last example:
The solution in this PR is to simply compare the result against Time.parse so we should get the exact same result since they're using the same parser (and hence parsing logic) to come up with whatever date it is.
In practice, parsing time+timezone without a date is perhaps a rare case?