There is a response from MS AD about the expiration date of the ultrasound in the Windows NT time format. You need to convert it to a regular date (YYYY-MM-DD, for example). Unfortunately, I did not find ready-made solutions for GOlang. Please suggest how to implement this task.

Sample response received: 131805158950000000, which will be equal to 2018-09-04, 6:24:55

  • What accuracy is needed? Seconds / milliseconds / microseconds? - Ainar-G

1 answer 1

Here is an example taken from the syscall package:

 const ntToUnixDiff = 116444736000000000 func ntToTime(ntt int64) time.Time { var nsec int64 = (ntt - ntToUnixDiff) * 100 return time.Unix(0, nsec) } 

The code in syscall is https://github.com/golang/go/blob/76c45877c9e72ccc84db787dc08299e0182e0efb/src/syscall/types_windows.go#L351 .

Playground: https://play.golang.org/p/cgkFXEKX0KG .