Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tmux won't display 12 hour time

Tags:

tmux

I've set the clock-mode-style option to use 12 hour time in my .tmux.conf, as described in the manpages:

set-window-option -g clock-mode-style 12

I then saved my changes and reloaded my config using :source-file ~/.tmux.conf, but the clock still shows in 24 hour time:

tmux clock using 24 hour time

like image 951
dspacejs Avatar asked Mar 26 '18 09:03

dspacejs


1 Answers

clock-mode-style and clock-mode-colour are the two options for the clock-mode window.
As an example here's a blog about this mode.

To achieve what you want (having a 12 hours clock in the status bar) you should change the status bar config in your tmux configuration to something like:

set -g status-right "#[fg=cyan]%A, %d %b %Y %I:%M %p"

tmux uses strftime to configure it's status line:

status-right string
Display string to the right of the status bar. By default, the current window title in double quotes, the date and the time are shown. As with status-left, string will be passed to strftime(3), character pairs are replaced, and UTF-8 is dependent on the status-utf8 option.

you can use @mbuckbee's "For a Good strftime" website to play with the configuration.

like image 83
pfmaggi Avatar answered Oct 13 '22 11:10

pfmaggi