The datetime module is usually more convenient for date/time arithmetic. However in your particular case, you may find the time.time() function convenient. It returns the number of seconds since the epoch. To get the number of days divide the number of seconds by 86400.