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 | |
from dateutil import relativedelta | |
a = datetime(1985,1,1) | |
b = datetime(2000,1,28) | |
delta = relativedelta.relativedelta(b,a) | |
years = delta.years | |
months = delta.months | |
days = delta.days | |
print("Range of variable hire_date is",years, "years",months, "months", days, "days") |
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
__author__ = 'Amal G Jose' | |
from datetime import datetime | |
from dateutil import relativedelta | |
##Aug 7 1989 8:10 pm | |
date_1 = datetime(1989, 8, 7, 20, 10) | |
##Dec 5 1990 5:20 am | |
date_2 = datetime(1990, 12, 5, 5, 20) |