pig-monkey.com

Undertime

Undertime is a simple program that assists in coordinating events across time zones. It prints a table of your system’s local time zone, along with other any other specified zones. The output is colorized based on the start and end hour of the working day. If you want to talk to someone in Paris tomorrow, and you want the conversation to happen at an hour that is reasonable for both parties, Undertime can help.

Undertime Paris Meeting Example

I often find myself converting between local time and UTC. Usually this happens when working with system logs. If I have a specific date and time I want to translate, I’ll use date.

# Convert a time from PDT to UTC:
$ env TZ="UTC" date -d "2016-03-25T11:33 PDT"
# Convert a time from UTC to local:
$ date -d '2016-03-24T12:00 UTC'

If I’m not looking to convert an exact time, but just want to answer a more generalized question like “Approximately when was 14:00 UTC?” without doing the mental math, I find that Undertime is the quickest solution.

$ undertime UTC
╔═══════╦═══════╗
║  PDTUTC  ║
╠═══════╬═══════╣
║ 00:0007:00 ║
║ 01:0008:00 ║
║ 02:0009:00 ║
║ 03:0010:00 ║
║ 04:0011:00 ║
║ 05:0012:00 ║
║ 06:0013:00 ║
║ 07:0014:00 ║
║ 08:0015:00 ║
║ 09:0016:00 ║
║ 10:0017:00 ║
║ 11:0018:00 ║
║ 12:0019:00 ║
║ 13:0020:00 ║
║ 14:0021:00 ║
║ 15:0022:00 ║
║ 16:0023:00 ║
║ 17:0000:00 ║
║ 18:0001:00 ║
║ 19:0002:00 ║
║ 19:0402:04 ║
║ 20:0003:00 ║
║ 21:0004:00 ║
║ 22:0005:00 ║
║ 23:0006:00 ║
╚═══════╩═══════╝
Table generated for time: 2019-07-23 19:04:00-07:00