Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 19 lines (15 sloc) 0.588 kb
#!/usr/bin/env python
import argparse
import wtftz
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='WTF Timezones?! Convert a '
'time from utc (default) to another tz.')
parser.add_argument('time', help="The time to convert")
parser.add_argument('to', help="The target timezone")
parser.add_argument('from_tz', metavar="from", nargs="?",
default="utc", help="The source timezone.")
args = parser.parse_args()
try:
print(wtftz.convert(args.time, args.to, args.from_tz))
except Exception:
print(args.time)
Jump to Line
Something went wrong with that request. Please try again.