Display local time and UTC time

Asked by Chris Johnston

I want to display both my local time and UTC in byobu.. I thought about making a script for it, but I wasn't sure if running a script every second would take up too many resources.. Is there an easy/good way to do this?

Question information

Language:
English Edit question
Status:
Solved
For:
byobu Edit question
Assignee:
No assignee Edit question
Solved by:
Dustin Kirkland 
Solved:
Last query:
Last reply:
Revision history for this message
Best Dustin Kirkland  (kirkland) said :
#1

Oooh, what a fun question ;-)

You're mostly correct ... running this every second would be fairly expensive.

The default date/clock in byobu is a screen built-in feature. It's
part of the compiled C code and is therefore pretty fast.

Here's a reasonable hack though ...

Assuming you're on the latest byobu version, you can do this...

$ mkdir $HOME/.byobu/bin
$ vi $HOME/.byobu/10_utc
#!/bin/sh
echo "$(date +%H:%M:%S) ($(date -u +%H:%M:%S) UTC)"
$ chmod 755 $HOME/.byobu/10_utc

See how that works for you ;-)

Note that you could drop the two %S from that echo line, if
minute-granularity is close enough.

Revision history for this message
Chris Johnston (cjohnston) said :
#2

Thanks Dustin Kirkland, that solved my question.

Revision history for this message
Chris Johnston (cjohnston) said :
#3

This works close enough Dustin.. Thanks!