AM/PM or 24 hour in ps

Edwin Groothuis edwin at mavetju.org
Sat Jun 27 12:42:33 UTC 2009


Hi,

One of the things I would like to see in ps(1) before I die (note
that it might take a long time before this happens) is that the
time started is working in the 24 hour format, were convinient for
the local settings.

The current implementation of ps(1) has already this in it, except
that it doesn't work because we have the format X_FMT_AMPM set for
every locale and thus ps(1) displays it in the AM/PM format.

So, the question is more or less.... How can a program figure out
if the current locale prefers AM/PM notation or the 24 hour notation?



USER    PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED      TIME COMMAND
edwin  1138  0.0  0.3  4408  2112  v0  I+    9:10PM   0:00.01 -bash (bash)
edwin  1145  0.0  0.2  3476  1448  v0  I+    9:10PM   0:00.00 /bin/sh /usr/loca

vs

USER    PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED      TIME COMMAND
edwin  1138  0.0  0.3  4408  2112  v0  I+   21:10     0:00.01 -bash (bash)
edwin  1145  0.0  0.2  3476  1448  v0  I+   21:10     0:00.00 /bin/sh /usr/loca


Edwin

-- 
Edwin Groothuis		Website: http://www.mavetju.org/
edwin at mavetju.org	Weblog:  http://www.mavetju.org/weblog/


More information about the freebsd-i18n mailing list