Rich Enhanced Shell History - Contextual shell history for zsh and bash
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
resh/cmd/get-epochtime/main.go

17 lines
325 B

package main
import (
"fmt"
"time"
)
// Small utility to get epochtime in millisecond precision
// Doesn't check arguments
// Exits with status 1 on error
func main() {
fmt.Printf("%s", timeToEpochTime(time.Now()))
}
func timeToEpochTime(t time.Time) string {
return fmt.Sprintf("%.2f", float64(t.UnixMilli())/1000)
}