Documentation ¶
Index ¶
- Constants
- Variables
- func CheckSETime(startTime, endTime string) bool
- func IntToString(t int) string
- func IntToStringDate(t int) string
- func IntToStringTime(t int) string
- func NowMilliTimeStamp() int64
- func NowTimeStamp() int
- func NowTimeStr() string
- func StringToInt(t string) int
- type JsonTime
- type Time
Constants ¶
View Source
const ( FormatDateTime = "2006-01-02 15:04:05" FormatDate = "2006-01-02" FormatTime = "15:04:05" LayoutDateTime = "2006-01-02 15:04:05" LayoutDate = "2006-01-02" LayoutTime = "15:04:05" LayoutDateTimeNum = "20060102150405" TimeZoneSH = "Asia/Shanghai" )
Variables ¶
Functions ¶
func CheckSETime ¶ added in v0.9.7
CheckSETime 检查开始时间和结束时间
func IntToString ¶
IntToString 将int转换为时间字符串 例如: 1560000000 -> 2019-06-09 00:00:00
func IntToStringDate ¶
IntToStringDate 将int转换为日期字符串 例如: 1560000000 -> 2019-06-09
func IntToStringTime ¶
IntToStringTime 将int转换为时间字符串 例如: 1560000000 -> 00:00:00
func NowMilliTimeStamp ¶ added in v0.10.0
func NowMilliTimeStamp() int64
NowMilliTimeStamp 获取当前时间戳(毫秒) 例如: 1560000000000
func NowTimeStr ¶ added in v0.2.3
func NowTimeStr() string
NowTimeStr 获取当前时间字符串 例如: 2019-06-09 00:00:00
func StringToInt ¶
StringToInt 将时间字符串转换为int 例如: 2019-06-09 00:00:00 -> 1560000000
Types ¶
type JsonTime ¶
func (JsonTime) MarshalJSON ¶
type Time ¶ added in v0.1.6
func StringToTime ¶ added in v0.10.4
StringToTime 将时间字符串转换为time 例如: 2019-06-09 00:00:00 -> time
func (Time) MarshalJSON ¶ added in v0.1.6
Click to show internal directories.
Click to hide internal directories.