当前位置:网站首页>Golang time format sorting
Golang time format sorting
2022-07-03 08:12:00 【Bel_ AMI classmate】
// Time format sorting
func toTime(jcrq string) string {
loc, _ := time.LoadLocation("Asia/Shanghai") // Set time zone
tt, _ := time.ParseInLocation("2006-01-02 15:04:05", jcrq, loc) // Format the time string as golang Of "time.Time" object
tm := time.Unix(tt.Unix(), 0)
return tm.Format("2006-01-02") // return Y-m-d Format
}
边栏推荐
- Basic operation and process control 2
- 2021-10-19
- Golang json格式和结构体相互转换
- Transplantation of tslib Library
- I want to do large screen data visualization application feature analysis
- P1896 [scoi2005] non aggression (shape pressure DP)
- jsutlis
- [step on the pit series] MySQL failed to modify the root password
- How does yarn link help developers debug NPM packages?
- 【cocos creator】点击按钮切换界面
猜你喜欢

An article for you to understand - Manchester code

What is a data type? What is the use of data types?

haproxy+keepalived搭建01

Viz artist advanced script video tutorial -- stringmap use and vertex operation

璞华PLM为全场景产品生命周期管理赋能,助力产品主线的企业数字化转型

How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03

VMware virtual machine configuration static IP

Scite change background color

Xlua task list youyou

A tunnel to all ports of the server
随机推荐
Use filechannel to copy files
Conversion between JSON and object
Golang json格式和结构体相互转换
2020-12-12
Worldview satellite remote sensing image data / meter resolution remote sensing image
VMware virtual machine configuration static IP
Abstract classes and interfaces
Initial unity
Zohocrm deluge function application time verification
idea取消引用显示效果
P2622 light off problem II (state compression search)
Iterm2 setting
A tunnel to all ports of the server
璞华PLM为全场景产品生命周期管理赋能,助力产品主线的企业数字化转型
C语言-入门-精华版-带你走进编程(一)
How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03
[cocos creator] get the resource UUID
Haproxy+kept build 01
MAE
Xlua task list youyou