How to minus time with Python
Question: I'd like to get the time before X seconds before `datetime.time.now()`. For
example, if the `time.now()` is `12:59:00`, and I minus `59`, I want to get
`12:00:00`.

How can I do that?


Answer: [You can use time
delta](https://docs.python.org/2/library/datetime.html#timedelta-objects) like
this:

    
    
    import datetime
    
    print datetime.datetime.now() - datetime.timedelta(minutes=59)
    

