I want to write a function that takes in a string representing timestamp, then change the year, month and day of that timestamp but not the actual time. Then I want to return the resulting timestamp as a string. I'm having some trouble with the conversion, since I think I need to convert in the following sequence: string -> timestamp -> date -> timestamp -> string. I've read through the datetime library, but I'm having some trouble with this conversion. Any assistance, would be much appreciated!
Function inputs would look like this:
def change_date(string: timestamp, string: new_date)
#timestamp: string formatted like 1601403951777
#new_date: string formatted like YYYY-MM-DD
For instance timestamp 1601403951777 is Tuesday, September 29, 2020.