time module

back

time module

author:FIL - IEEA - Univ. Lille1.fr <http://portail.fil.univ-lille1.fr>_
date:October, 2015

Module for time representation.

exception Time.InvalidTimeError(msg)[source]
Time.compare(d1, d2)[source]
Parameters:
  • d1 (time) –
  • d2 (time) –
Returns:

  • -1 if duration d1 is shorter than duration d2
  • 1 if duration d1 is longer than duration d2
  • 0 otherwise

Return type:

int

UC:

none

Time.create(h, m, s)[source]
Parameters:
  • h (int) – number of hours
  • m (int) – number of minutes
  • s (int) – number of seconds
Returns:

a duration

Return type:

time

UC:

0 <= h, 0 <= m,s < 60

Time.get_hours(d)[source]
Parameters:d (time) –
Returns:number of hours of duration d
Return type:int
UC:none
Time.get_minutes(d)[source]
Parameters:d (time) –
Returns:number of minutes of duration d
Return type:int
UC:none
Time.get_secondes(d)[source]
Parameters:d (time) –
Returns:number of secondes of duration d
Return type:int
UC:none