python-minari-date/minari_date/__main__.py

16 lines
273 B
Python
Raw Normal View History

2021-03-19 14:42:41 +00:00
from datetime import datetime
import sys
from dateutil.parser import parse
from . import MinariDateTime
if len(sys.argv) > 1:
timestamp = parse(sys.argv[1]).replace(tzinfo=None)
else:
timestamp = datetime.utcnow()
dt = MinariDateTime(timestamp)
print(str(dt))