[Python3] Get date diff

There is a convenient site called days calculation. http://keisan.casio.jp/exec/system/1177658154

I will reproduce something like this.

calc_days.py


import datetime
a = datetime.date(2015, 4, 1)
b = datetime.date(2016, 1, 25)
print((b-a).days)
# 299

By the way, this value does not include the first day, so if you want to write the ~ day, add +1.

Recommended Posts

[Python3] Get date diff
Get date in Python
Get date with python
Get the contents of git diff from python
[Python] Get environment variables
[Python] Get Qiita trends
Date manipulation in Python
[Python] Get the last updated date of the website
[Python2] Date string-> UnixTime-> Date string
Date calculation in python
[Python] Split the date
Date calculation in Python
python get current time
Get the update date of the Python memo file.
Get YouTube Comments in Python
Get country code with python
Python --bitflyer Get asset balance
[python] Convert date to string
Get last month in python
Get Twitter timeline with python
Get Youtube data with python
Get Terminal size in Python
[Python] Get the previous month
Explicitly get EOF in python
Get thread ID with python
Get started with Python! ~ ② Grammar ~
String date manipulation in Python
[python] Get quotient and remainder
Get stock price with Python
Get Evernote notes in Python
python> Get substring> print serial [5:10] / print serial [5: -1]
Get home directory with python
Get keyboard events with python
IfcOpenShell python bindings get started
(Python) Get AWS billing amount
Python --bitflyer Get chat content
Get Alembic information with Python
Sort by date in python
Python> dictionary> get ()> optional value
Get Japanese synonyms in Python
Get the current date and time in Python, considering the time difference
Get Leap Motion data in Python.
Get started with Python! ~ ① Environment construction ~
Link to get started with python
Python
Get data from Quandl in Python
Get reviews with python googlemap api
Get the desktop path in Python
Get the weather with Python requests
Get web screen capture with python
Get the weather with Python requests 2
Get the script path in Python
How to get the Python version
[Python] Get the update date of a news article from HTML
How to get started with Python
[Small story] Get timestamp with Python
Get, post communication memo in Python
Get Qiita trends with Python scraping
Get upcoming weather from python weather api
How to calculate date with python
Get the desktop path in Python