mirror of https://github.com/curusarn/resh
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.
17 lines
325 B
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)
|
|
}
|
|
|