true halloween newyears false newyears halloween true newyears !oct true make datetime object for the first moment (midnightof october and store it in halloween make datetime object for the first moment of january and store it in newyears then make another object for midnight on october and store it in oct comparing halloween and oct shows that they're equal comparing newyears and halloween shows that newyears is greater (laterthan halloween the timedelta data type the datetime module also provides timedelta data typewhich represents duration of time rather than moment in time enter the following into the interactive shellu delta datetime timedelta(days= hours= minutes= seconds= delta daysdelta secondsdelta microseconds ( delta total_seconds( str(delta' days : : to create timedelta objectuse the datetime timedelta(function the datetime timedelta(function takes keyword arguments weeksdayshoursminutessecondsmillisecondsand microseconds there is no month or year keyword argumentbecause " monthor " yearis variable amount of time depending on the particular month or year timedelta object has the total duration represented in dayssecondsand microseconds these numbers are stored in the dayssecondsand microseconds attributesrespectively the total_seconds(method will return the duration in number of seconds alone passing timedelta object to str(will return nicely formattedhuman-readable string representation of the object in this examplewe pass keyword arguments to datetime delta(to specify duration of days hours minutesand secondsand store the returned timedelta object in delta this timedelta object' days attributes stores and its seconds attribute stores ( hours minutesand secondsexpressed in secondsv calling total_seconds(tells us that days hours minutesand seconds is , seconds finallypassing the timedelta object to str(returns string that plainly describes the duration