From 7022486e936e404996508806914285d1f1f21674 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 5 Dec 2018 15:52:38 +0800 Subject: [PATCH] Package gview: build-in function 'date' supports printing current datetime. --- g/os/gview/gview.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/g/os/gview/gview.go b/g/os/gview/gview.go index 2cf3807a2..4c900d485 100644 --- a/g/os/gview/gview.go +++ b/g/os/gview/gview.go @@ -294,7 +294,8 @@ func (view *View) funcDate(format string, timestamp...interface{}) string { t := int64(0) if len(timestamp) > 0 { t = gconv.Int64(timestamp[0]) - } else { + } + if t == 0 { t = gtime.Millisecond() } return gtime.NewFromTimeStamp(t).Format(format)