this should be a bug, date +%X

J dreadpiratejeff at gmail.com
Fri Oct 12 22:57:56 UTC 2012


On Fri, Oct 12, 2012 at 6:07 PM, Evuraan <evuraan at gmail.com> wrote:
> man date says:
>
>        %X     locale’s time representation (e.g., 23:13:48)
>
> date (GNU coreutils) 7.4 gives:
>
> $ date +%X
> 03:04:42 PM
> ^^           ^^^^^------- this
>
> instead it should just be
>
> $ date +%X
> 15:04:42

No it shouldn't... check your locale.  For example, en_US:

% Appropriate time representation (%X)
%       "%r"
t_fmt   "<U0025><U0072>"
%
% Appropriate AM/PM time representation (%r)
%       "%I:%M:%S %p"
t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U0070>"


This tells date that the appropriate time representation for the en_US
locale is exactly what you are seeing.




More information about the ubuntu-users mailing list