casdoor/util/time.go

17 lines
264 B
Go
Raw Normal View History

2021-02-11 22:56:08 +08:00
package util
2021-04-28 19:02:01 +08:00
import (
"strconv"
"time"
)
2021-02-11 22:56:08 +08:00
func GetCurrentTime() string {
timestamp := time.Now().Unix()
tm := time.Unix(timestamp, 0)
return tm.Format(time.RFC3339)
}
2021-04-28 19:02:01 +08:00
func GetCurrentUnixTime() string {
return strconv.FormatInt(time.Now().UnixNano(), 10)
}