当前位置:网站首页>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
}
边栏推荐
- [usaco12mar]cows in a skyscraper g (state compression DP)
- Golang中删除字符串的最后一个字符
- About Wireshark's unsuccessful installation of npcap
- Generate video using clipout in viz engine
- Compilation error: "not in executable format: file format not recognized"“
- oracle中的 (+)是什么意思
- Golang 时间格式整理
- Zohocrm deluge function application time verification
- P2622 light off problem II (state compression search)
- YOLO系列 --- xml2txt脚本
猜你喜欢
the installer has encountered an unexpected error installing this package
JS common basic case sorting (continuous update)
超限黑客认知
About the problem that the editor and the white screen of the login interface cannot be found after the location of unityhub is changed
Wpf: solve the problem that materialdesign:dialoghost cannot be closed
PostGIS space function
the installer has encountered an unexpected error installing this package
Minimap plug-in
Oracle insert single quotation mark
Easy touch plug-in
随机推荐
CLion-Toolchains are not configured Configure Disable profile问题解决
What is BFC?
Initial unity
Flex flexible box layout
LwIP learning socket (application)
Oracle insert single quotation mark
Multi traveling salesman problem -- overview of formula and solution process
Golang url的编码和解码
oracle中的 (+)是什么意思
【cocos creator】获取资源uuid
Client server model
Idea dereference display effect
Free use until 2015 -- viz artist multi touch plug-in package
Register keyword
什麼是定義?什麼是聲明?它們有何區別?
How to clear the console password for s7700 device
[end of 2021] National Meteorological Short Video (Kwai, Tiktok) influence list in December
The difference between hdmi2.1 and hdmi2.0 and the conversion of PD signals.
What is a data type? What is the use of data types?
Get to know unity2 for the first time