I need to convert command line argument date from '2020-08-20' format to '2020-08-21T00:00:00-07:00' format?
I tried
from datetime import datetime
datetime.strptime(start_date, "%Y-%m-%d").date()
I need to convert command line argument date from '2020-08-20' format to '2020-08-21T00:00:00-07:00' format?
I tried
from datetime import datetime
datetime.strptime(start_date, "%Y-%m-%d").date()
Try this:
from datetime import datetime
datetime.strptime(start_date, '%Y-%m-%d').isoformat()
Python version: 3.8