Documentation
¶
Index ¶
- Constants
- Variables
- func AddDatesToDate(days int) string
- func AddDatesToDateTime(days int) string
- func AddDatesToTime10(days int) int64
- func AddDatesToTime13(days int) int64
- func AddDaysToZeroTime10(days int) int64
- func CurrentDate() string
- func CurrentDateTime() string
- func Date19ToTime13(t string) int64
- func DateTs14ToTime13(t string) int64
- func DateTs17ToTime13(t string) int64
- func Millisecond() int64
- func RFC3339ToDateTime(t string) (string, error)
- func Second() int64
- func Tim13ToYearMonthSlice(startTime int64, endTime int64) []int
- func Time10ToDate(t int64) string
- func Time10ToTime(t int64) time.Time
- func Time13ToDate(t int64) string
- func Time13ToDateTime(t int64) string
- func Time13ToDateTs14(t int64) string
- func Time13ToDateTs17(t int64) string
- func Time13ToTS8(t int64) string
- func Time13ToTime(t int64) time.Time
- func TimeToTime13(t time.Time) int64
- func TimeZoneParse(seconds int64) string
Constants ¶
const ( FormatDateTime = "2006-01-02 15:04:05" FormatDate = "2006-01-02" FormatDateTS17 = "20060102150405000" FormatDateTS14 = "20060102150405" FormatDateTS8 = "20060102" FormatDateTS6 = "200601" )
Variables ¶
var LOC, _ = time.LoadLocation("Asia/Shanghai")
Functions ¶
func AddDatesToDate ¶
AddDatesToDate time.Now() 通过增加days返回days天后的日期 2006-01-02 格式,days可以是负数
func AddDatesToDateTime ¶
AddDatesToDateTime time.Now() 通过增加days返回days天后的日期与时间 2006-01-02 15:04:05 格式,days可以是负数
func AddDatesToTime10 ¶
AddDatesToTime10 time.Now() 通过增加days返回days天后的10位时间戳,days可以是负数
func AddDatesToTime13 ¶
AddDatesToTime13 time.Now() 通过增加days返回days天后的13位时间戳,days可以是负数
func AddDaysToZeroTime10 ¶
AddDaysToZeroTime10 time.Now() 通过增加days返回days天后 00:00:00 时的10位时间戳,days可以是负数
func CurrentDateTime ¶
func CurrentDateTime() string
CurrentDateTime time.Now() 获取当前日期与时间 2006-01-02 15:04:05 格式
func Date19ToTime13 ¶
Date19ToTime13 日期19位转13位时间戳,例如 2016-11-14 14:31:16 转13位时间戳
func DateTs14ToTime13 ¶
DateTs14ToTime13 日期Ts14位转13位时间戳,例如 20161114143116 转13位时间戳
func DateTs17ToTime13 ¶
DateTs17ToTime13 日期Ts17位转13位时间戳,例如 20161114143116001 转13位时间戳
func RFC3339ToDateTime ¶
RFC3339ToDateTime RFC3339格式数据 2006-01-02T15:04:05Z 转日期与时间 2006-01-02 15:04:05 格式
func Tim13ToYearMonthSlice ¶
Tim13ToYearMonthSlice 输入开始和结束的13位时间戳,输出其包含的年份和月份数组,例如 [202209, 202210]
func Time10ToDate ¶
Time10ToDate 10位时间戳转日期与时间 2006-01-02 15:04:05 格式
func Time13ToDateTime ¶
Time13ToDateTime 13位时间戳转日期和时间 2006-01-02 15:04:05 格式
func Time13ToDateTs14 ¶
Time13ToDateTs14 13位时间戳转日期Ts14位,例如 20161114143116 格式
func Time13ToDateTs17 ¶
Time13ToDateTs17 13位时间戳转日期Ts17位,例如 20161114143116001 格式
func TimeZoneParse ¶
TimeZoneParse TimeZoneParse, 返回 1970-01-01 08:00:00 后加 seconds 秒之后的日期与时间 2006-01-02 15:04:05 格式
Types ¶
This section is empty.