If you want to convert a string type to a datetime type, the common way is to use strptime(date_string, format)
. But it is quite inconvenient to specify the structure of your datetime string, such as %Y-%m-%d %H:%M:%S
.
To convert the string to datetime automatically, use maya. You just need to parse the string, and maya will figure out the structure of your string.