1
xuboying 2017-03-10 15:43:24 +08:00 via Android
try catch
|
2
coolair OP formats = ['%Y-%m-%d', '%Y%m%d', '%Y%m']
for item in formats: ....try: ........datetime.strptime(value, item) ....except: ........pass |