I want a time in the below-mentioned format, using Python.
Tue, 08 Nov 2022 15:35:20 GMT
- I should be able to get the current time in above format;
- Then I should be able to add days in it and get the date and time in the same above-mentioned format (for example, I want date falling on after
nnumber of days).
Any help would be highly appreciated.
I have tried the below code but not getting the desired results:
start_date = str(datetime.now()).split(".")[0]
due_date = str((datetime.now() + timedelta(days=2))).split(".")[0]
Output:
2022-11-08 23:45:15
2022-11-10 23:45:15
You can try to use the below functions: