From b333760272b4de80dcf69b4a47c3aecca7ffa430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Thu, 10 Aug 2023 12:17:09 +0800 Subject: [PATCH] =?UTF-8?q?time=E5=8C=85=E8=A3=85=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0String=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- time.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/time.go b/time.go index b67fa6e..6d857ae 100644 --- a/time.go +++ b/time.go @@ -135,6 +135,15 @@ func (t *Time) FormatUnixSec(layout ...string) string { return time.Unix(t.Unix(), 0).In(time.Local).Format(t.getTimeFormat(StandTimeFormat, layout...)) } +// String 转字符串 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 12:16 2023/8/10 +func (t *Time) String(layout ...string) string { + return t.FormatUnixSec(layout...) +} + // getTimeFormat 获取时间格式 // // Author : go_developer@163.com<白茶清欢>