Quantcast
Channel: Convert string "Jun 1 2005 1:33PM" into datetime - Stack Overflow
Viewing all articles
Browse latest Browse all 55

Answer by Grant Shannon for Convert string "Jun 1 2005 1:33PM" into datetime

$
0
0

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)


Viewing all articles
Browse latest Browse all 55

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>