Solution was:
import pandas as pd
ts = pd.to_datetime(str(date))
d = ts.strftime('%Y.%m.%d')
More Related Contents:
- How to print a date in a regular format?
- Converting between datetime, Timestamp and datetime64
- Iterating through a range of dates in Python
- How do I get the day of week given a date?
- Creating a range of dates in Python
- Adding days to a date in Python
- Find the end of the month of a Pandas DataFrame Series
- How to format date string via multiple formats in python
- In Python, how do you convert seconds since epoch to a `datetime` object?
- Check if string has date, any format
- Find the closest date to a given date
- Pandas: Subtracting two date columns and the result being an integer
- Generate a list of datetimes between an interval
- Splitting timestamp column into separate date and time columns
- Extract day of year and Julian day from a string date
- Comparing two date strings in Python
- Get year, month or day from numpy datetime64
- Get week start date (Monday) from a date column in Python (pandas)?
- Pandas: How to create a datetime object from Week and Year?
- Convert date to datetime in Python
- Which is the fastest way to extract day, month and year from a given date?
- Using datetime as ticks in Matplotlib
- Getting days since last occurence in Pandas DataFrame?
- Formatting “yesterday’s” date in python
- Keep a datetime.date in ‘yyyy-mm-dd’ format when using Flask’s jsonify
- Resample time series in pandas to a weekly interval
- Convert a column of timestamps into periods in pandas
- Clean way to convert quarterly periods to datetime in pandas
- How to combine year, month, and day columns to single datetime column?
- Convert dates to pd.to_datetime where month could be either a number or month name