[ Cmii ] [ Octopus ] - 优化项目结构

This commit is contained in:
zeaslity
2024-03-19 16:04:09 +08:00
committed by zeaslity
parent 4ca8d77e74
commit 6b4616690c
80 changed files with 979 additions and 1025 deletions

View File

@@ -0,0 +1,29 @@
package utils
import (
"time"
)
// ParseDateTimeTime 输出系统时间的格式为"2006-01-02 15:04:05"形式的时间字符串
func ParseDateTimeTime() string {
now := time.Now()
/*loc := time.FixedZone("UTC+8", 8*60*60) // 创建东八区时区对象
localTime := now.In(loc) // 转换为东八区时间*/
return now.Format(time.DateTime)
}
// ParseISOLocalDateTime 时间格式为2023-08-11T10:48:15+08:00
func ParseISOLocalDateTime() string {
now := time.Now()
return now.Format(time.RFC3339)
}
func TimeSplitFormatString() string {
now := time.Now()
formattedTime := now.Format("2006-01-02-15-04-05")
return formattedTime
}