chrono.clock.Clock - Basic 24-hour clock

class chrono.clock.Clock

Basic 24-hour clock handling.

classmethod julian(hour, minute, second)

Returns the julian time for the given time, as a float between 0.0 and 1,0.

Raises chrono.error.HourError, chrono.error.MinuteError, or chrono.error.SecondError if hour, minute, or second is invalid.

classmethod julian_to_time(julian)

Converts a julian time as a float between 0 and 1 to a tuple of hour, minute, and second. For values > 0, only the decimal part is used.

Raises chrono.error.TimeError on invalid input.

classmethod validate(hour, minute, second)

Validates a time: hour must be in range 0-23, minute in range 0-59, and second in range 0-59.

Raises chrono.error.HourError, chrono.error.MinuteError, or chrono.error.SecondError if hour, minute, or second is invalid.

classmethod validate_hour(hour)

Validates an hour: must be in range 0-23.

Raises chrono.error.HourError if hour is invalid.

classmethod validate_minute(minute)

Validates a minute: must be in range 0-59.

Raises chrono.error.MinuteError is minute is invalid.

classmethod validate_second(second)

Validates a second: must be in range 0-59.

Raises chrono.error.SecondError is second is invalid.

Previous topic

chrono.clock - Clock-related classes

Next topic

chrono.clock.USClock - US 12-hour clock