mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 17:16:38 +08:00
17 lines
278 B
Go
17 lines
278 B
Go
package helper
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
// GetTimestamp get current timestamp in seconds
|
|
func GetTimestamp() int64 {
|
|
return time.Now().Unix()
|
|
}
|
|
|
|
func GetTimeString() string {
|
|
now := time.Now()
|
|
return fmt.Sprintf("%s%d", now.Format("20060102150405"), now.UnixNano()%1e9)
|
|
}
|