-
-
Save fatosmorina/d16f25a7e330c8f8f920a8ef1cd4c0f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
first_date = datetime(2021, 10, 26) | |
second_date = datetime(2020, 5, 26) | |
month_difference = first_date.month - second_date.month | |
year_difference = first_date.year - second_date.year | |
month_difference = month_difference + 12 * year_difference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment