-
-
Save jomat/a4e284bf5b19f5aef806 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import pytz, datetime | |
now_utc = datetime.datetime.utcnow() | |
now_utc = pytz.utc.localize(now_utc) | |
for tzstring in pytz.all_timezones: | |
local_tz = pytz.timezone(tzstring) | |
local_time = now_utc.astimezone(local_tz) | |
h=int(local_time.strftime('%H')) | |
if h==16 or h == 15 or h == 4 or h == 3: | |
m=int(local_time.strftime('%M')) | |
if (m <= 20 and (h == 4 or h == 16)) or (m > 20 and (h==3 or h == 15)): | |
print tzstring+": "+local_time.strftime('%H:%M') |
I'll keep that thing and give it an alias like "is_it_beertime" :D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
\o/