当前位置:网站首页>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
}
边栏推荐
- Easy touch plug-in
- Three characteristics
- 多旅行商问题——公式和求解过程概述
- WPF:解决MaterialDesign:DialogHost 无法关闭问题
- Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does
- RM delete file
- [end of 2021] National Meteorological Short Video (Kwai, Tiktok) influence list in December
- How does yarn link help developers debug NPM packages?
- [untitled]
- Ventuz Foundation Series "one step at the door"
猜你喜欢
oracle 插入单引号
*p++、*++p、++*p、(*p)++
C#课程设计之员工信息管理系统
WPF:解决MaterialDesign:DialogHost 无法关闭问题
STM32F103 SPI (pit Diary)
方正锐利重磅升级到12.0版本,包装印前处理更加便捷、高效!
Editor Extensions
Install cross compiler arm none liunx gnueabihf
Unity XR realizes interaction (grasping, moving, rotating, transmitting, shooting) -pico
the installer has encountered an unexpected error installing this package
随机推荐
Shader foundation 01
WorldView卫星遥感影像数据/米级分辨率遥感影像
Register keyword
璞华PLM为全场景产品生命周期管理赋能,助力产品主线的企业数字化转型
How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03
多旅行商问题——公式和求解过程概述
WPF:解决MaterialDesign:DialogHost 无法关闭问题
一条通往服务器所有端口的隧道
Huawei switch basic configuration (telnet/ssh login)
E: 无法定位软件包 ros-melodic-desktop-full
一个实习生的CnosDB之旅
Viz artist advanced script video tutorial -- stringmap use and vertex operation
使用 FileChannel 进行文件的复制拷贝
vcs import src < ros2. Repos failed
Lua hot update basic grammar
Unity2019_ Lighting system
About Wireshark's unsuccessful installation of npcap
idea取消引用显示效果
[untitled]
What does (+) in Oracle mean