INTRODUCTION
The function returns date object with same year, month and day. All arguments are required. Arguments may be integers, in the following ranges:
- MINYEAR <= year <= MAXYEAR
- 1 <= month <= 12
- 1 <= day <= number of days in the given month and year
If an argument outside those ranges is given, ValueError is raised.
- Note: The smallest year number allowed in a date or datetime object. MINYEAR is 1.
- The largest year number allowed in a date or datetime object. MAXYEAR is 9999.
PROGRAM
----------------------------------------------
from datetime import date
f_date = date(2014, 7, 2)
l_date = date(2014, 7, 11)
delta = l_date - f_date
print(delta.days)
----------------------------------------------
Output:
9
No comments:
Post a Comment