Golang time.Time.Nanosecond() function example

package time

Golang time.Time.Nanosecond() function usage example.

 package main

 import (
 "fmt"
 "time"
 )

 func main() {

 now := time.Now()

 fmt.Println("Today : ", now.Format(time.ANSIC))

 nano := now.Nanosecond()

 fmt.Println("Nanosecond : ", nano)
 }

Sample output :

Today : Mon Aug 10 11:55:17 2015

Nanosecond : 257731502

Reference :

http://golang.org/pkg/time/#Time.Nanosecond

Advertisement