Skip to content

Instantly share code, notes, and snippets.

@kylebrandt
Last active August 29, 2015 14:07
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 kylebrandt/92671689da33c3075326 to your computer and use it in GitHub Desktop.
Save kylebrandt/92671689da33c3075326 to your computer and use it in GitHub Desktop.
Convert Windows 100NS Epoch (Timestamp_Sys100NS) To a Unix Epoch
func TSys100NStoEpoch(nsec uint64) int64 {
//nsec is really 100*NS
//Got this constant from https://golang.org/src/pkg/syscall/ztypes_windows.go, not sure where it comes from, but seems to work
nsec -= 116444736000000000
seconds := nsec / 1e7
return int64(seconds)
}
@chrismalek
Copy link

Thanks, this helped me today.

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