Standard library / time

time.Time.UnixNano()

Return nanoseconds since Unix epoch; undefined outside the representable int64 range, including the zero Time. Expected stdout: '1500000000\n'.

Formal Syntax & Structure

go syntaxgo
func (t Time) UnixNano() int64

Return Value

int64

Return nanoseconds since Unix epoch; undefined outside the representable int64 range, including the zero Time.

Working Example

Example Snippetgo
package main
import (  "fmt"  "time")
func main() { fmt.Println(time.Unix(1, 500000000).UnixNano()) }
Go Reference