Page 1 of 1

Remove leading zero from desktop clock

Posted: Mon 30 Sep 2013, 13:52
by cimarron
To remove the leading zero from single digit hours or dates on the desktop clock, just add a dash/minus before the desired digit in this line in .jwmrc-tray (hidden in the root directory). Like this:

Code: Select all

<Clock format="%-I:%M%p"></Clock>
Restart JWM to see the change.

(That's if you use JWM, but it should be similar in other window managers. Adding the dash also works for times and dates in other places, such as in the Spacefm file manager, where you can specify the format for date and time of file modifications)

So instead of 08:51AM, the clock will now show this:

Posted: Mon 30 Sep 2013, 14:30
by Flash
Works like a charm. :D
Out of idle curiosity, how did you discover this?

Posted: Mon 30 Sep 2013, 15:41
by L18L
Flash wrote:Works like a charm. :D
Out of idle curiosity, how did you discover this?
Type or paste

Code: Select all

date --help
into a console and press ENTER key :wink:

Posted: Mon 30 Sep 2013, 16:39
by cimarron
I found the tip on a blog post about XFCE, and just tried it. But L18L's info is better; lots more options. I like AM/PM better in lower case too (use %P instead of %p).

Posted: Wed 06 Nov 2013, 23:15
by toronado
Thanks. Works for me in PHATSlacko5502.

Posted: Thu 07 Nov 2013, 14:50
by L18L
toronado wrote:...Works...
date is NOT puppy and is NOT linux it is GNU

http://www.gnu.org/software/coreutils/m ... -date.html

:D

Posted: Thu 07 Nov 2013, 19:50
by toronado
L18L wrote:
toronado wrote:...Works...
date is NOT puppy and is NOT linux it is GNU

http://www.gnu.org/software/coreutils/m ... -date.html

:D
OK. It reminds me a little bit of http://dev.mysql.com/doc/refman/5.5/en/ ... ate-format