manage g201

This commit is contained in:
2020-05-13 01:30:04 +02:00
parent cd513d97e2
commit 9907a66542
2 changed files with 41 additions and 16 deletions

View File

@@ -11,4 +11,13 @@ def dateFmt(date):
return t
except ValueError:
d = datetime.datetime.strptime(t, '%d-%m-%Y')
return datetime.datetime.strftime(d, "%Y-%m-%d")
return datetime.datetime.strftime(d, "%Y-%m-%d")
def dateTimeFmt(date):
t = date.replace("/","-")
try:
datetime.datetime.strptime(t, '%Y-%m-%d %H:%M:%S')
return t
except ValueError:
d = datetime.datetime.strptime(t, '%d-%m-%Y %H:%M:%S')
return datetime.datetime.strftime(d, "%Y-%m-%d %H:%M:%S")