Programming Code Center(PCC)
[GO]

(PCC)::[How-to-use-Epoch-to-get-number-of-seconds,-milliseconds,-or-nanoseconds-in-go-language]::[go]

File Name : epoch.go

package main

import (
    "fmt"
    "time"
)

func main() {

    now := time.Now()
    secs := now.Unix()
    nanos := now.UnixNano()
    fmt.Println(now)

    millis := nanos / 1000000
    fmt.Println(secs)
    fmt.Println(millis)
    fmt.Println(nanos)

    fmt.Println(time.Unix(secs, 0))
    fmt.Println(time.Unix(0, nanos))
}

Output :

epoch.jpg