Python Adding one hour to time.time()
Question: Hi i want to add one hour to Python time.time().

My current way of doing it is :

    
    
    t = int(time.time())
    expiration_time = t + 3600
    

Is this considered bad for any reasons? If so is there a better way of doing
this easily.


Answer: It's not considered bad for any reason . I do it this way many times . Here is
an example :

    
    
    import time
    t0 = time.time()
    print time.strftime("%I %M %p",time.localtime(t0))
    03 31 PM
    t1 = t0 + 60*60
    print time.strftime("%I %M %p",time.localtime(t1))
    04 31 PM
    

Here are other ways of doing it using 'datetime'

    
    
    import datetime
    t1 = datetime.datetime.now() + datetime.timedelta(hours=1)
    t2 = datetime.datetime.now() + datetime.timedelta(minutes=60)
    

