Documentation ¶
Overview ¶
Package timex Create on 2023/6/16 @author xuzhuoxi
Package timex Create on 2023/8/16 @author xuzhuoxi
Index ¶
- Constants
- Variables
- func DurationFrom(t time.Time) time.Duration
- func FormatNow(layout string) string
- func FormatTime(time time.Time, layout string) string
- func FormatUnixMilli(millisecond int64, layout string) string
- func FormatUnixNano(nanosecond int64, layout string) string
- func FormatUnixSecond(second int64, layout string) string
- func FromMilli(ms int64) time.Time
- func FromNano(ns int64) time.Time
- func FromSecond(sec int64) time.Time
- func NowDuration() time.Duration
- func NowDuration1970() time.Duration
- func NowFloatHours() float64
- func NowFloatHours1970() float64
- func NowFloatMinutes() float64
- func NowFloatMinutes1970() float64
- func NowFloatSeconds() float64
- func NowFloatSeconds1970() float64
- func NowHours() int64
- func NowHours1970() int64
- func NowMilliseconds() int64
- func NowMilliseconds1970() int64
- func NowMinutes() int64
- func NowMinutes1970() int64
- func NowNanos() int64
- func NowNanos1970() int64
- func NowSeconds() int64
- func NowSeconds1970() int64
- func NowTicks() int64
- func NowTicks1970() int64
- func ParseDuration(durationStr string) time.Duration
- func TimeFrom(d time.Duration) time.Time
Constants ¶
View Source
const ( StdLongMonth = "January" StdMonth = "Jan" StdNumMonth = "1" StdZeroMonth = "01" StdLongWeekDay = "Monday" StdWeekDay = "Mon" StdDay = "2" StdUnderDay = "_2" StdZeroDay = "02" StdHour = "15" StdHour12 = "3" StdZeroHour12 = "03" StdMinute = "4" StdZeroMinute = "04" StdSecond = "5" StdZeroSecond = "05" StdLongYear = "2006" StdYear = "06" StdPM = "PM" Stdpm = "pm" StdTZ = "MST" StdISO8601TZ = "Z0700" //prints Z for UTC StdISO8601SecondsTZ = "Z070000" StdISO8601ShortTZ = "Z07" StdISO8601ColonTZ = "Z07:00" //prints Z for UTC StdISO8601ColonSecondsTZ = "Z07:00:00" StdNumTZ = "-0700" //always numeric StdNumSecondsTz = "-070000" StdNumShortTZ = "-07" //always numeric StdNumColonTZ = "-07:00" //always numeric StdNumColonSecondsTZ = "-07:00:00" )
Variables ¶
Functions ¶
func FormatUnixMilli ¶
func FormatUnixNano ¶
func FormatUnixSecond ¶
func NowDuration ¶ added in v1.0.4
func NowDuration1970 ¶ added in v1.0.4
func NowFloatHours ¶ added in v1.0.4
func NowFloatHours() float64
func NowFloatHours1970 ¶ added in v1.0.4
func NowFloatHours1970() float64
func NowFloatMinutes ¶ added in v1.0.4
func NowFloatMinutes() float64
func NowFloatMinutes1970 ¶ added in v1.0.4
func NowFloatMinutes1970() float64
func NowFloatSeconds ¶ added in v1.0.4
func NowFloatSeconds() float64
func NowFloatSeconds1970 ¶ added in v1.0.4
func NowFloatSeconds1970() float64
func NowHours1970 ¶ added in v1.0.4
func NowHours1970() int64
func NowMilliseconds ¶ added in v1.0.4
func NowMilliseconds() int64
func NowMilliseconds1970 ¶ added in v1.0.4
func NowMilliseconds1970() int64
func NowMinutes ¶ added in v1.0.4
func NowMinutes() int64
func NowMinutes1970 ¶ added in v1.0.4
func NowMinutes1970() int64
func NowNanos1970 ¶ added in v1.0.4
func NowNanos1970() int64
func NowSeconds ¶ added in v1.0.4
func NowSeconds() int64
func NowSeconds1970 ¶ added in v1.0.4
func NowSeconds1970() int64
func NowTicks1970 ¶ added in v1.0.4
func NowTicks1970() int64
func ParseDuration ¶ added in v1.0.4
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.