1

Is there any way to configure my system to show different timezone clocks together at the same time on Linux? I am about to enroll to online courses substitutes classes from the usual in-person classes due to Covid-19 travel restriction. The timezone of classes schedules are set based on their local time or EST time whichever these (if they are different than the other) time they used, it is different from my local time.

I want my system to display two different times side by side with one another. It could be showing two different widgets along side on the screen or use some application that is equivalent to world clock on Android or iOS.

All information related to Linux and time configuration I have found on internet are either about application doesn't show the correct time or has to do with how to set the system clock to work with the hardware clock so the system shows the correct time or dual boot with Windows time problems. Link1. and Link2.

I know that there are other strategies to deal with this problem such as use two different physical clocks or watches, use Android or iOS devices for different timing references, google time converter every time, etc. I just want to know if there is any existed solution for this problem that works on Linux or more specifically Ubuntu.

The Linux distro I am using is Ubuntu dual booting with Windows 10 so it is likely that both systems clocks are configured to use local time. According to Link1 above, Ubuntu by default is set to use local time when dual booting with Windows, but I was a distro hopper before I settled with Ubuntu. If later I found out that my system clocks or hardware clocks were set to UTC or different than the default stated in Link1, it wouldn't be a surprise but I think I have fixed them to both system using local time.

Note: Showing two different timezone clocks together may result in inaccuracy of the time displayed due to various factors that could be a big stand alone discussing topic so in this case I don't need a precise reference time that is accurate to second-by-second level, but the inaccuracy I can tolerate should not exceed 45 minutes inaccuracy. Ideally I am looking for +- 5-15 minutes of inaccuracy if inaccuracy cannot be avoid.

1
  • Your second reference is dated 1998, and I doubt its current accuracy. Your first reference claims Ubuntu and derivatives (like my Mint) use UTC on machines tainted by Windows, and I don't observe that. My Mint resets UTC and sets the clock by NTP on every boot. My Win7 assumes local time on each reboot, but does not reset the clock until some weekly schedule I can't change, so in summer I had to reset time manually every time I switched from Mint to Win7. Commented Jun 13, 2020 at 9:59

1 Answer 1

3

Timezone is just a variable exported for you. These work simultaneously:

TZ=EST xclock -d &
TZ=GMT xclock -d &

I don't observe any inaccuracy in times. I have BST, GMT and EST running with -update 1 enabled, and there is no observable difference, which means they are probably within 1/20 second. I will let you know what happens at end of summer-time.

6
  • So, I can just type the command you suggested on terminal directly and it would work, right? I asked because I don’t familar with those commandline. Commented Jun 14, 2020 at 11:46
  • Yes. The TZ is a global setting, but with a command immediately following, that change just applies to that single command. The & makes it run in background, the -d makes it digital, and it comes up in its own X-window. man xclock tells you the options. Run tzselect to find explicit timezones. Example: I run tzselect, type 2 for Americas, 49 for USA, 18 for Mountain, and it recommends TZ='America/Denver'. That's all on Linux Mint -- your distro may be slightly different. Commented Jun 14, 2020 at 12:23
  • It was recommended at the end of tzselect command to add this line tz=YourPreferTimezone to my .profile, but once I did so it shows only one timezone instead of two. Commented Jun 16, 2020 at 2:12
  • Bad recommendation by them. Adding it to your .profile is a permanent change, intended to become your 'home' timezone. It now gets applied to every terminal when you log in. I was pretty specific in a previous comment: "The TZ is a global setting, but with a command immediately following, that change just applies to that single command". If you want one clock to show somebody else's timezone, you need to avoid changing your own global one. Commented Jun 16, 2020 at 10:25
  • Addition: Changing your own home TZ does no permanent damage: it just alters the way times are displayed. But you might notice it affects the ls output, and I really wouldn't like to rely on date, cron, at, touch and some find options right now, being as TZ affects their perception of concepts like tomorrow etc. So best to undo the .profile edit soon. Commented Jun 16, 2020 at 10:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .