Remove leading zero from desktop clock

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

Remove leading zero from desktop clock

#1 Post 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:
Attachments
clock.png
(2.49 KiB) Downloaded 595 times
Last edited by cimarron on Tue 01 Oct 2013, 13:16, edited 3 times in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

Works like a charm. :D
Out of idle curiosity, how did you discover this?

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#3 Post 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:

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#4 Post 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).

toronado
Posts: 95
Joined: Wed 04 Sep 2013, 21:09

#5 Post by toronado »

Thanks. Works for me in PHATSlacko5502.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#6 Post 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

toronado
Posts: 95
Joined: Wed 04 Sep 2013, 21:09

#7 Post 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

Post Reply