mascara for hour 24: 00h

1

Good evening guys.

I would like to help you with a problem. I have a field on my form to receive time. But what I found few validate. Most do so: When typing 24:00 turns to 00:00 ... but that's what I want to avoid. In my field I need to put 24:00 ... it would be 23:59 24:00 now if I type 24:01 then yes it would have to stay 00:01 ... Do you have any tips on how I can do this?

    
asked by anonymous 11.10.2016 / 03:31

1 answer

1

According to the ISO 8601 , which is an international standard for date and time representation, the two representations are correct: 24:00 and 00:00. But W3C defines that the <input> of type date must accept the date in the format specified by RFC 3339 , which contains:

  

Although ISO 8601 allows the time to be "24", this profile of ISO 8601 only allows values between "00" and "23" for the time, in order to reduce confusion.

It is not only RFC 3339 that discourages the "24:00" form - style manuals and military regulations in some countries also discourage use. The manual for the US Navy and the US Marine Corps formally specifies as valid values from 0001 to 2359. ( Font )

Although it is possible to make a component that accepts the value 24:00, I do not see much advantage in working to format the date in an unordered format.

    
11.10.2016 / 04:41