How to get current time in milliseconds since Unix Epoch with Go

1 Answer

0 votes
package main

import (
	"fmt"
	"time"
)

func main() {
	timeInMillis := time.Now().UnixNano() / int64(time.Millisecond)
	
	fmt.Println(timeInMillis)
}


/*
run:

1728224899367

*/

 



answered Oct 6, 2024 by avibootz
...