1

【笔记】Go获取当前时间

 1 year ago
source link: https://loli.fj.cn/2023/04/06/Go%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E6%97%B6%E9%97%B4/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

【笔记】Go获取当前时间

2023-04-06

Go获取当前时间

日期类型当前时间

time.Now()

格式化日期类型为字符串类型

2006:相当于yyyy
01:相当于MM
02:相当于dd
15:相当于24小时制的hh
04:相当于mm
05:相当于ss

time.Now().Format("2006-01-02 15:04:05")

知乎——Golang发烧友
CSDN——msw、


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK