how to add/subtract 2 days in the target day in python?
Question: I have a problem in adding or subtracting 2 days to the target day... here is
my code :

    
    
    import datetime
    
    target_date = datetime.date(2011,2,7)
    

thanks


Answer: Use
[`datetime.timedelta`](http://docs.python.org/library/datetime.html#datetime.timedelta):

    
    
    import datetime
    target_date = datetime.date(2011,2,7)
    
    delta = datetime.timedelta(days=2)
    new_date = target_date - delta
    
    print new_date # 2011-02-05
    

