You can use the pandas.to_datetime()
method to convert the date string to a datetime object and then format it using the strftime()
method. Here's an example:
main.py323 chars14 lines
Output:
main.py53 chars5 lines
Note: the "%-d" and "%-m" format codes are used to remove leading zeros from the day and month values respectively.
gistlibby LogSnag