|
|
@ -26,6 +26,11 @@ func GetUnixNow() Timestamp {
|
|
|
|
return Timestamp(time.Now().Unix())
|
|
|
|
return Timestamp(time.Now().Unix())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GetUnixNow 取得現在時間戳記
|
|
|
|
|
|
|
|
func GetUnixNanoNow() Timestamp {
|
|
|
|
|
|
|
|
return Timestamp(time.Now().UnixNano())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetUnix 嘗試取得時間戳記
|
|
|
|
// GetUnix 嘗試取得時間戳記
|
|
|
|
func GetUnix(format, datetime string) (Timestamp, error) {
|
|
|
|
func GetUnix(format, datetime string) (Timestamp, error) {
|
|
|
|
t, err := time.ParseInLocation(format, datetime, Local)
|
|
|
|
t, err := time.ParseInLocation(format, datetime, Local)
|
|
|
|