Documentation
¶
Index ¶
- Constants
- func CalDay(t time.Time, n int) time.Time
- func ChangeLoc(t time.Time, target string) time.Time
- func CompareDay(t1, t2 time.Time) int
- func Cp56time2aToTime(hexStr string) (time.Time, error)
- func GetFirstDateOfMonth(d time.Time) time.Time
- func GetLastDateOfMonth(d time.Time) time.Time
- func GetZeroTime(d time.Time) time.Time
- func NowFmtStr(fmtStr string) string
- func NowMillis() int64
- func NowNano() int64
- func NowSecond() int64
- func NowStr() string
- func NowStr2() string
- func Parse(str string) (time.Time, error)
- func ParseWithFmt(fmt, str string) (time.Time, error)
- func SetTimeZero(t time.Time) time.Time
- func TimeFmtStr(t time.Time, fmt string) string
- func TimeFromStamp(s, ns int64) time.Time
- func TimeFromStampMillis(ms int64) time.Time
- func TimeMillis(t time.Time) int64
- func TimeNano(t time.Time) int64
- func TimeSecond(t time.Time) int64
- func TimeStr(t time.Time) string
- func TimeToCp56time2a(t time.Time) string
- func Tomorrow() time.Time
- func UTCbyTime(t time.Time) (time.Time, error)
- func Yesterday() time.Time
- type Time
Constants ¶
View Source
const ( DateFormat = "2006-01-02" DateCompactFormat = "20060102" TimeFormat = "2006-01-02 15:04:05" LongFormat = "2006-01-02 15:04:05.999" CompactFormat = "20060102150405" // 紧凑型格式 AllFormat = "2006-01-02 15:04:05.999999999 -0700 MST" )
Variables ¶
This section is empty.
Functions ¶
func GetFirstDateOfMonth ¶
获取传入的时间所在月份的第一天,即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。
func GetLastDateOfMonth ¶
获取传入的时间所在月份的最后一天,即某月最后一天的0点。如传入time.Now(), 返回当前月份的最后一天0点时间。
func TimeFromStamp ¶
TimeFromStamp 时间戳 参数 s 为秒 ns 为纳秒 注:最后的时间为s+ns的结果 millis := nanos / 1000000 // 毫秒
func TimeFromStampMillis ¶
func TimeMillis ¶
func TimeSecond ¶
func TimeToCp56time2a ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.