@property<EOL><INDENT>def hours(self):<DEDENT>
if not isinstance(self.duration, tuple):<EOL><INDENT>return self.duration<EOL><DEDENT>if self.duration[<NUM_LIT:1>] is None:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>time_start = self.get_start_time()<EOL>if time_start is None:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>now = datetime.datetime.now()<EOL>time_start = now.replace(<EOL>hour=time_start.hour,<EOL>minute=time_start.minute, second=<NUM_LIT:0><EOL>)<EOL>time_end = now.replace(<EOL>hour=self.duration[<NUM_LIT:1>].hour,<EOL>minute=self.duration[<NUM_LIT:1>].minute, second=<NUM_LIT:0><EOL>)<EOL>total_time = time_end - time_start<EOL>total_hours = total_time.seconds / <NUM_LIT><EOL>return total_hours<EOL>
Return the number of hours this entry has lasted. If the duration is a tuple with a start and an end time,
the difference between the two times will be calculated. If the duration is a number, it will be returned
as-is.