mirror of https://github.com/etesync/server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
404 B
15 lines
404 B
from distutils.util import strtobool
|
|
from datetime import datetime
|
|
import pytz
|
|
|
|
def argbool(arg):
|
|
if arg == None: return None
|
|
return bool(strtobool(arg))
|
|
|
|
def argdate(arg):
|
|
if arg == None: return None
|
|
try:
|
|
return pytz.utc.localize(datetime.strptime(arg, '%Y-%m-%d %H:%M:%S'))
|
|
except ValueError:
|
|
return pytz.utc.localize(datetime.strptime(arg, '%Y-%m-%d %H:%M:%S.%f'))
|