I want to use datetime.datetime.now() to create the time in the following format to match the output from an API: 2022-02-25T18:05:00+00:00.
When I use dtypes on the API output it says datetime64[ns, UTC]. I'm not sure what that means.
I want to use datetime.datetime.now() to create the time in the following format to match the output from an API: 2022-02-25T18:05:00+00:00.
When I use dtypes on the API output it says datetime64[ns, UTC]. I'm not sure what that means.
 
    
    Using dt.strftime, this is as close as you get:
>>> df["column"] = df["column"].dt.strftime("%Y-%m-%dT%H:%M:%S%z")
>>> df
                     column
0  2022-02-25T20:25:16+0000
But you can go all the way operating on the string
>>> df["column"] = df["column"].str.slice(stop=-2) + ":" + df["column"].str.slice(start=-2)
>>> df
                      column
0  2022-02-25T20:25:16+00:00
