Answers for "convert a string of datetime to number"

2

convert str to datetime

import datetime

# str value "Apr 2, 2019" convert into any format. 
datetime.datetime.strptime('Apr 2, 2019', '%b %d, %Y').strftime('%a, %d %b %Y')
Posted by: Guest on May-13-2020
0

how to convert string to datetime

import datetime
datetime.datetime.strptime(date_string, format)
Posted by: Guest on January-05-2021

Code answers related to "convert a string of datetime to number"

Python Answers by Framework

Browse Popular Code Answers by Language