Future Date Calculator with Delorean

  • Share this:

Code introduction


This function takes parameters for years, months, days, hours, minutes, and seconds and calculates a future date from the current time using the Delorean library.


Technology Stack : Delorean

Code Type : Date time processing

Code Difficulty : Intermediate


                
                    
def travel_to_future(year, months=0, days=0, hours=0, minutes=0, seconds=0):
    from delorean import Delorean
    future_date = Delorean().add(years=year, months=months, days=days, hours=hours, minutes=minutes, seconds=seconds)
    return future_date                
              
Tags: