当前位置:网站首页>Golang 时间格式整理
Golang 时间格式整理
2022-07-03 08:04:00 【Bel_Ami同学】
// 时间格式整理
func toTime(jcrq string) string {
loc, _ := time.LoadLocation("Asia/Shanghai") //设置时区
tt, _ := time.ParseInLocation("2006-01-02 15:04:05", jcrq, loc) // 将时间字符串格式化为golang的"time.Time"对象
tm := time.Unix(tt.Unix(), 0)
return tm.Format("2006-01-02") // 返回Y-m-d格式
}
边栏推荐
- Demonstration of plug-in use of ventuz basic series
- 使用 FileChannel 进行文件的复制拷贝
- Open the influence list of "National Meteorological Short Videos (Kwai, Tiktok) in November" in an interactive way“
- Idea unreference Display Effect
- oracle 插入单引号
- Transfinite hacker cognition
- 数据库应用技术课程设计之商城管理系统
- Haproxy+kept build 01
- What is a data type? What is the use of data types?
- 超限黑客认知
猜你喜欢

Haproxy+kept build 01

I want to do large screen data visualization application feature analysis

*p++、*++p、++*p、(*p)++

Install cross compiler arm none liunx gnueabihf

MAE

Basic operation and process control 2

Are you still watching the weather forecast on TV?

多旅行商问题——公式和求解过程概述

Multi traveling salesman problem -- overview of formula and solution process

Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products
随机推荐
Technical dry goods Shengsi mindspire dynamic transformer with variable sequence length has been released!
An article for you to understand - Manchester code
Project experience sharing: handwritten Chinese character recognition based on Shengsi mindspire
*p++、*++p、++*p、(*p)++
Technical dry goods | thinking about the unification of dynamic and static diagrams of AI framework
Quelle est la définition? Qu'est - ce qu'une déclaration? Quelle est la différence?
MAE
Wpf: solve the problem that materialdesign:dialoghost cannot be closed
What to do after the browser enters the URL
使用 FileChannel 进行文件的复制拷贝
Usage of (case, when) in PostgreSQL
What is BFC?
An intern's journey to cnosdb
Technology dry goods | Roberta of the migration of mindspore NLP model - emotion analysis task
C language - Introduction - essence Edition - take you into programming (I)
Zohocrm deluge function application time verification
Youyou1 of xlua knapsack system
Huawei switches are configured with SSH login remote management switches
Use filechannel to copy files
haproxy+keepalived集群搭建02