Standard library / time

time.UnixMilli()

Construct a local-location Time from milliseconds since the Unix epoch. Expected stdout: '1970-01-01T00:00:01.5Z\n'.

Formal Syntax & Structure

go syntaxgo
func UnixMilli(msec int64) Time

Parameters & Attributes

NameTypeDescription
msecint64Milliseconds since Unix epoch.

Return Value

Time

Construct a local-location Time from milliseconds since the Unix epoch.

Working Example

Example Snippetgo
package main
import (  "fmt"  "time")
func main() { fmt.Println(time.UnixMilli(1500).UTC().Format(time.RFC3339Nano)) }
Go Reference