Documentation ¶
Index ¶
- Constants
- Variables
- func Any(timezone, layout string) string
- func CheckTime(timestamp int64, start string, end string, timezone string) int
- func CheckTimeNow(start string, end string, timezone string) int
- func ClickhouseDatatimeRange() (time.Time, time.Time)
- func Date(timezone string) string
- func DateTime(timezone string) string
- func DiffInDays(t1, t2 int64) int
- func GetWeekDay(timezone string) (string, string)
- func ISOWeek(timezone string) string
- func ParseAny(value any) (goTime time.Time, err error)
- func ParseDateTime(datetime string, timezone string) time.Time
- func ParseTimestamp(timestamp int64, timezone string) time.Time
- func ToAny(timestamp int64, timezone string, layout string) string
- func ToDate(timestamp int64, timezone string) string
- func ToDateTime(timestamp int64, timezone string) string
- func ToISOWeek(timestamp int64, timezone string) string
- func ToISOWeekByDate(datetime string, timezone string) string
- func ToUnix(datetime string, timezone string) int64
- func Unix(timezone string) int64
Constants ¶
View Source
const LayoutDate = "2006-01-02"
View Source
const LayoutDateHour = "2006-01-02 15"
View Source
const LayoutDateTime = "2006-01-02 15:04:05"
View Source
const LayoutDateTimeZone = "2006-01-02 15:04:05 -0700 MST"
View Source
const LayoutDateTimeZoneT = "2006-01-02T15:04:05.999999-07:00"
View Source
const LayoutTime = "15:04:05"
Variables ¶
View Source
var Single = &single{}
Functions ¶
func CheckTimeNow ¶
CheckTimeNow 检查当前时间 0未开始、1正常、2已结束,半闭合区间[start, end)
func ClickhouseDatatimeRange ¶ added in v1.0.5
clickhouse datetime类型底层以时间戳存储,不包含时区
func ParseDateTime ¶
ParseDateTime 解析日期时间
func ParseTimestamp ¶
ParseTimestamp 解析时间戳 秒级
func ToISOWeekByDate ¶
ToISOWeekByDate 转成年周 例如2020_5
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.