From 2b63956905c6cdceabd7c97591fa77314caa3561 Mon Sep 17 00:00:00 2001 From: Stanly Date: Wed, 9 Mar 2022 22:06:58 +0800 Subject: [PATCH] Add GetUnixNanoNow --- types/timestamp.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/timestamp.go b/types/timestamp.go index bfcd250..b60f8f4 100644 --- a/types/timestamp.go +++ b/types/timestamp.go @@ -26,6 +26,11 @@ func GetUnixNow() Timestamp { return Timestamp(time.Now().Unix()) } +// GetUnixNow 取得現在時間戳記 +func GetUnixNanoNow() Timestamp { + return Timestamp(time.Now().UnixNano()) +} + // GetUnix 嘗試取得時間戳記 func GetUnix(format, datetime string) (Timestamp, error) { t, err := time.ParseInLocation(format, datetime, Local)