mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-22 17:30:29 +08:00
上传日期相关公共函数
This commit is contained in:
12
internal/utils/dateutils/utils.go
Normal file
12
internal/utils/dateutils/utils.go
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// Copyright 2023 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||||
|
|
||||||
|
package dateutils
|
||||||
|
|
||||||
|
// SplitYmd 分隔Ymd格式的日期
|
||||||
|
// Ymd => Y-m-d
|
||||||
|
func SplitYmd(day string) string {
|
||||||
|
if len(day) != 8 {
|
||||||
|
return day
|
||||||
|
}
|
||||||
|
return day[:4] + "-" + day[4:6] + "-" + day[6:]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user