We can calculate date by adding minutes in python.To do this first we need to import datetime and time Delta function from datetime as shown below.

In the example below we have given the current date by adding minutes in it we want to calculate date.

from datetime import datetime,timedelta #date is string date='1-12-2022 00:00' #convert string to datetime object dt=datetime.strptime(date,'%d-%m-%Y %H:%M') # add minutes in the current date enddate=dt + timedelta(minutes=int(1445)) print(enddate) #it will result in date and time result: 2022-12-02 00:05:00

By SC

Leave a Reply

Your email address will not be published. Required fields are marked *