Closed boeckmann closed 13 hours ago
TIME
accepts both time formats (24h/12h), independently of the locale settings. The syntax is either time 14:00:00
or time 02:00:00P
. Minutes and seconds are optional, so time 2p
should work as well. Only the first argument is checked, anything else is ignored.
Perhaps time
should display an error if more than 1 argument is passed. And the help probably needs to be improved so the above rules are clear.
Improved TIME's help screen. Also failing if more than one argument is passed. Should be more user-friendly now.
I have translated the new string to PL only, so it is displayed in EN for all other languages.
Willi Spiegl reported that the time command accepts a 12-hr time string like
02:00:00 PM
even when the time format is set to a 24-hr, and then sets a wrong time. This only happens if the time is given as command line parameter, not when time asks the user to enter it.Probable cause: as the time string is split into two command line parameters, time may simply ignore a AM or PM given?
From Willis original mail: