Documentation ¶
Index ¶
- Constants
- Variables
- func CurrentTimeMillis() int64
- func DaysCountOfMonth(year, month int) int
- func ElapsedDaysBetween(start, end time.Time) int
- func EndOfWeek(t time.Time) time.Time
- func FirstDayOfYear(year int) time.Time
- func FormatTime(t time.Time) string
- func FormatUnixTime(v int64) string
- func IsLeapYear(year int) bool
- func LastDayOfYear(year int) time.Time
- func MidnightTimeOf(t time.Time) time.Time
- func MustParseDateTime(s string) time.Time
- func MustParseMomentDate(tm time.Time, s string) time.Time
- func MustParseMomentTime(tm time.Time, s string) time.Time
- func MustParseTime(s string) time.Time
- func ParseDateParts(s string, seg []int) error
- func ParseDateTime(s string) (time.Time, error)
- func ParseMomentDate(tm time.Time, dateText string) (time.Time, error)
- func ParseMomentTime(tm time.Time, timeText string) (time.Time, error)
- func ParseTimeParts(s string, seg []int) error
- func StartingOfWeek(t time.Time) time.Time
- func ThisMomentAfterDays(this time.Time, days int) time.Time
- func TimeToMillis(t time.Time) int64
- type Clock
Constants ¶
View Source
const ( DateFormat = "2006-01-02 15:04:05" TimestampFormat = "2006-01-02 15:04:05.999" )
View Source
const (
DefaultTickInterval = 400 // 400毫秒tick一次
)
Variables ¶
View Source
var ( DefaultLoc = time.Local FirstDayIsMonday = true )
View Source
var ( DummyTime time.Time DateFormatSep = "-" TimeFormatSep = ":" DateTimeSep = " " )
Functions ¶
func MustParseDateTime ¶
func ParseMomentDate ¶
根据当前时间和字符串日期,生成一个新的time.Time对象
func ParseMomentTime ¶
根据当前时间和字符串日期,生成一个新的time.Time对象
Types ¶
Click to show internal directories.
Click to hide internal directories.