Similar to Javed above, I just wanted date from string - so combining Simon and Javed's logic (above) we get:
from dateutil import parserimport datetimes='2021-03-04'parser.parse(s).date()
output
datetime.date(2021, 3, 4)
Similar to Javed above, I just wanted date from string - so combining Simon and Javed's logic (above) we get:
from dateutil import parserimport datetimes='2021-03-04'parser.parse(s).date()
output
datetime.date(2021, 3, 4)