From 61d6840bdb441643fdbc74cdc5ecb9b116df2727 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 15 Feb 2019 14:29:51 +0800 Subject: [PATCH] - add func utils.IsTimeZero --- utils/typeconv.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/typeconv.go b/utils/typeconv.go index 24494d54..9d87b998 100644 --- a/utils/typeconv.go +++ b/utils/typeconv.go @@ -283,6 +283,10 @@ func Str2TimeWithDefault(timeStr string, defValue time.Time) time.Time { return retVal } +func IsTimeZero(timeValue time.Time) bool { + return timeValue == DefaultTimeValue || timeValue == ZeroTimeValue +} + func HTTPResponse2Json(response *http.Response) (map[string]interface{}, error) { var jsonResult map[string]interface{} bodyData, err := ioutil.ReadAll(response.Body)