Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 18, 2021 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/4b957a79631317eb18a87ff5cfe23ffd to your computer and use it in GitHub Desktop.
Save parzibyte/4b957a79631317eb18a87ff5cfe23ffd to your computer and use it in GitHub Desktop.
def obtener_tiempo_transcurrido(segundos):
dias = int(segundos / 60 / 60 / 24)
segundos -= dias * 60 * 60 * 24
horas = int(segundos / 60 / 60)
segundos -= horas*60*60
minutos = int(segundos/60)
segundos -= minutos*60
return f"{dias} días, {horas} horas, {minutos} minutos y {segundos} segundos"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment