Skip to content

Instantly share code, notes, and snippets.

@rfjakob
Created September 29, 2015 06:26
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 rfjakob/6d3359a97d22f32083bc to your computer and use it in GitHub Desktop.
Save rfjakob/6d3359a97d22f32083bc to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"syscall"
"time"
)
func main() {
t := time.Date(1960, time.January, 10, 23, 0, 0, 0, time.UTC)
nsec := t.UnixNano()
tv := syscall.NsecToTimeval(nsec)
fmt.Printf(" t=%v \n nsec=%d \n tv.Sec=%d tv.Usec=%d \n", t, nsec, tv.Sec, tv.Usec)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment