coding手册

时间处理

1
2
3
4
5
// 获取毫秒时间戳
new Date().getTime()
// 自定义格式
moment().format('YYYY-MM-DD HH:mm:ss');
moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
1
2
3
4
// 获取毫秒时间戳
time.Now().UnixMilli()
// 自定义格式
time.Now().Format("2006-01-02 15:04:05")
1
2
3
4
// 获取毫秒时间戳
time.time()
// 自定义格式
datetime.now().strftime('%Y-%m-%d %H:%M:%S')

coding手册
https://maocat.cc/2023/01/01/基础/coding手册/
发布于
2023年1月1日
许可协议