Skip to content

Instantly share code, notes, and snippets.

@abdalmoez
Created January 7, 2020 11:59
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 abdalmoez/8772490c24fcda0732f599a67ad896e2 to your computer and use it in GitHub Desktop.
Save abdalmoez/8772490c24fcda0732f599a67ad896e2 to your computer and use it in GitHub Desktop.
Python convert nano seconds to string (hour, minute, seconds, ...)
def nsToStr(nanoseconds):
h=3.6e+12
m=h/60
s=m/60
return str(int(d/h)) +':'+str(int((d%h)/m))+':'+ str(int((d%h)%m/s)) + '.' + str(int((d%h)%m%s))
@V-Derbenev-Tizbi
Copy link

d is undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment