Skip to content

Time.utc can't handle hour 24 #1501

@ghostganz

Description

@ghostganz

I had some Rails code that broke when we went from MRI to JRuby, which I tracked down to this difference:

1.9.3-p448 :001 > Time.utc(2014, 2, 11, 24, 0)
=> 2014-02-12 00:00:00 UTC

2.1.0 :001 > Time.utc(2014, 2, 11, 24, 0)
=> 2014-02-12 00:00:00 UTC

jruby-1.7.10 :002 > Time.utc(2014, 2, 11, 24, 0)
ArgumentError: argument out of range.
from org/jruby/RubyTime.java:1114:in `utc'
...

The hour 24 is apparently ok according to the ISO standards, and the time formatting in iOS happily generates them, so we see a lot of them in our requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions