def datetime_to_seconds(date): """return the number of seconds since the begining of the day for that date """ return date.second+60*date.minute + 3600*date.hour