From b1ff96251b6f86299c575b9c5fbf4bb2d8fafc0a Mon Sep 17 00:00:00 2001 From: zhangxin Date: Wed, 30 Jun 2021 14:32:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E8=BD=AC?= =?UTF-8?q?=E6=88=90=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transfer/func.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/transfer/func.go b/transfer/func.go index 04fedf1..f0e7c9f 100644 --- a/transfer/func.go +++ b/transfer/func.go @@ -3,6 +3,7 @@ package transfer import ( "math" "strconv" + "time" ) func StringToInt(source string) (data int, err error) { @@ -27,4 +28,8 @@ func DecimalToIntCeil(source float64) (data int) { func DecimalToIntFloor(source float64) (data int) { return int(math.Floor(source)) +} + +func TimeToString(source time.Time, format string) (data string) { + return source.Format(format) } \ No newline at end of file