Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to add and subtract days datetime python

a_date = datetime.date(2015, 10, 10)
days = datetime.timedelta(5)

new_date = a_date - days
#Subtract 5 days from a_date


print(new_date)
#OUTPUT
#2015-10-05
Comment

PREVIOUS NEXT
Code Example
Python :: calcolatrice 
Python :: `distplot` is a deprecated function and will be removed in a future version 
Python :: python change base function 
Python :: scientific notation to decimal python 
Python :: resize numpy array image 
Python :: pandas drop columns by index 
Python :: date parser python pandas 
Python :: python get size of file 
Python :: python for doing os command execution 
Python :: english to japanese 
Python :: python test if string is int 
Python :: python how to get every name in folder 
Python :: python how to sort by date 
Python :: pandas merge dataframes from a list 
Python :: python discord input 
Python :: python every other goes to a list 
Python :: python how to set multiple conditional for single var 
Python :: python regex remove digits from string 
Python :: python find closest value in list to zero 
Python :: discord.py how to give a user a role 
Python :: pyqt5 display math 
Python :: registering static files in jango 
Python :: supprimer ligne python dataframe 
Python :: trump 
Python :: fiel to base64 python 
Python :: random string generator python 
Python :: how to find mean of one column based on another column in python 
Python :: python read music stream 
Python :: Set column as index with pandas 
Python :: openpyxl get last non empty row 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =