There are a few solutions possible, but I believe they will all involve Python string formatting.
Pandas will allow you to write a function - e.g., to convert a date to a string - and then apply that function to each row of a column. This feature uses the apply() function in Pandas.
Function to convert date to a string:
def convert_date_standard_string(datelike_object):
"""
Return string version of date in format mm/dd/yyyy
Parameters
-----------
datelike_object
A value of type date, datetime, or Timestamp.
(e.g., Python datetime.datetime, datetime.date,
Pandas Timestamp)
"""
return "{:%m/%d/%Y}".format(datelike_object)
Most of this function is documentation. The key part is return "{:%m/%d/%Y}".format(datelike_object)
, which uses Python string formatting to put the date into the desired format.
Here is an example DataFrame with a column created from the date_range function.
>>> dates_list = pd.date_range(start="01/01/2019", end="01/31/2019")
>>> df = pd.DataFrame(dates_list, columns=["Dates"])
>>> df
Dates
0 2019-01-01
1 2019-01-02
2 2019-01-03
3 2019-01-04
4 2019-01-05
5 2019-01-06
6 2019-01-07
7 2019-01-08
8 2019-01-09
9 2019-01-10
10 2019-01-11
...
27 2019-01-28
28 2019-01-29
29 2019-01-30
30 2019-01-31
Note: Although the dates are displayed with only the year, month, and day, each value actually holds the time information also, as the OP pointed out. In addition, the format is not what the OP needs.
>>> df["Dates"].loc[0]
Timestamp('2019-01-01 00:00:00')
Here is the syntax to apply the custom function created above to this column:
df["Dates"].apply(convert_date_standard_string)
Typically I would create a new column to store the converted values, like this:
>>> df["Dates - mm/dd/yyyy"] = df["Dates"].apply(convert_date_standard_string)
>>> df
Dates Dates - mm/dd/yyyy
0 2019-01-01 01/01/2019
1 2019-01-02 01/02/2019
2 2019-01-03 01/03/2019
3 2019-01-04 01/04/2019
4 2019-01-05 01/05/2019
5 2019-01-06 01/06/2019
6 2019-01-07 01/07/2019
7 2019-01-08 01/08/2019
8 2019-01-09 01/09/2019
9 2019-01-10 01/10/2019
10 2019-01-11 01/11/2019
...
27 2019-01-28 01/28/2019
28 2019-01-29 01/29/2019
29 2019-01-30 01/30/2019
30 2019-01-31 01/31/2019
To demonstrate that the new column is a string:
>>> df["Dates - mm/dd/yyyy"].loc[0]
'01/01/2019'
>>> type(df["Dates - mm/dd/yyyy"].loc[0])
<class 'str'>