Skip to content

How do I change the time plugin to 12hr format? #264

Answered by FelixKratz
shndowbots asked this question in Q&A
Discussion options

You must be logged in to vote

The time is provided by the command date. What you want is to find the argument which gives you 12 hour time format. To do this you use:

man date

What you will find is that %H is the hour in 24h format and %I the hour using 12h format. Additionally you will find that %p gives AM or PM depending on the current time. The command you are looking for is thus:

date '+%I:%M %p'

Replace the command invoked for the clock label with this one and you are good to go.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@shndowbots
Comment options

Answer selected by shndowbots
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants