首页 > 其他分享 >【Go】时间

【Go】时间

时间:2022-12-15 16:27:23浏览次数:34  
标签:12 15 31 35 时间 2022 time Go

String转Time

常规格式

t, _ := time.ParseInLocation("2006-01-02 15:04:05", "2022-12-15 14:35:31", time.Local)
fmt.Println(t)  // 2022-12-15 14:35:31 +0800 CST
ts, _ := time.ParseInLocation(time.RFC3339, "2022-12-15T14:35:31+08:00", time.Local)
fmt.Println(ts)  // 2022-12-15 14:35:31 +0800 CST

image

标签:12,15,31,35,时间,2022,time,Go
From: https://www.cnblogs.com/wangjinkui/p/16985306.html

相关文章