Skip to content

Instantly share code, notes, and snippets.

@maptv
Created June 30, 2025 08:02
Show Gist options
  • Save maptv/a77a773260cf2c5883371e11ee72e7d0 to your computer and use it in GitHub Desktop.
Save maptv/a77a773260cf2c5883371e11ee72e7d0 to your computer and use it in GitHub Desktop.
Fractional day time-of-day (tod) to hour-minute-second (hms) triplet
def tod_to_hms(tod):
hour, remainder = divmod(tod * 86400, 3600)
return int(hour), *map(int, divmod(remainder, 60))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment