Skip to content

Instantly share code, notes, and snippets.

Last active October 27, 2021 16:53
What would you like to do?
What time is it where your friends are?
#! /usr/bin/env python3
_facilities = {
"SLAC/ALS": "America/Los_Angeles",
"APS": "America/Chicago",
"NSLS-II": "America/New_York",
"DLS": "Europe/London",
"MAXIV": "Europe/Paris",
"SLS": "Europe/Paris",
"ESRF/SOLIEL": "Europe/Paris",
"EU-XFEL": "Europe/Berlin",
"S8": "Asia/Tokyo",
"PLS/PAL": "Asia/Seoul",
"AS": "Australia/Melbourne",
def world_clock(targets, pstring_format="%a %H:%M"):
from datetime import datetime
from dateutil import tz
ct =
print(f"{' '*15} {ct.strftime(pstring_format)}")
for n, zone in targets.items():
lt = ct.astimezone(tz.gettz(zone))
f"{n: <15} {lt.strftime(pstring_format)}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment