Documentation
¶
Index ¶
- Variables
- func BeginningOfDay(t time.Time) time.Time
- func BeginningOfHalf(t time.Time) time.Time
- func BeginningOfHour(t time.Time) time.Time
- func BeginningOfMinute(t time.Time) time.Time
- func BeginningOfMonth(t time.Time) time.Time
- func BeginningOfQuarter(t time.Time) time.Time
- func BeginningOfWeek(t time.Time, weekStartDay time.Weekday) time.Time
- func BeginningOfYear(t time.Time) time.Time
- func EndOfDay(t time.Time) time.Time
- func EndOfHalf(t time.Time) time.Time
- func EndOfHour(t time.Time) time.Time
- func EndOfMinute(t time.Time) time.Time
- func EndOfMonth(t time.Time) time.Time
- func EndOfQuarter(t time.Time) time.Time
- func EndOfWeek(t time.Time, weekStartDay time.Weekday) time.Time
- func EndOfYear(t time.Time) time.Time
- func Format(t time.Time, format ...string) string
- func From(str string, timeFormat ...string) (time.Time, error)
- func Now() time.Time
- func ToANSIC(t time.Time) string
- func ToHHmmss(t time.Time) string
- func ToPGTimestamp(t time.Time) string
- func ToRFC3339(t time.Time) string
- func ToTimeAndDate2(t time.Time) string
- func ToTimeAndDate2WithTimezone(t time.Time) string
- func ToYYYYMMDD(t time.Time) string
Constants ¶
This section is empty.
Variables ¶
var ( // TimeAndDate2 eg.2006-01-02 15:04:05 TimeAndDate2 = "2006-01-02 15:04:05" // TimeAndDate2 eg.2006-01-02 15:04:05 -0700 MST TimeAndDate2WithTimezone = "2006-01-02 15:04:05.999999999 -0700 MST" // PGTimestampStyle 2006-01-02 15:04:05.999999-07 PGTimestamp = "2006-01-02 15:04:05.999999-07" YYYY = "2006" YY = "06" MM = "01" DD = "02" H12 = "3" Minute = "04" SS = "05" Timezone = "MST" TimezoneOffset = "-0700" MMDDYY = "01/02/06" YYYYMMDD = "2006-01-02" HHmm = "15:04" HHmmss = "15:04:05" HmmssPM = "3:04:05 PM" AmPm = "PM" )
Time Formate format
Functions ¶
func BeginningOfDay ¶
BeginningOfDay 返回指定时间的当天内的第0小时 2013-11-18 00:00:00 Mon
func BeginningOfHalf ¶
BeginningOfHalf 返回指定时间所在半年的第0天 2013-07-01 00:00:00 Tue
func BeginningOfHour ¶
BeginningOfHour 返回指定时间的第0分钟 2013-11-18 17:00:00 Mon
func BeginningOfMinute ¶
BeginningOfMinute 返回指定时间的第0秒 2013-11-18 17:51:00 Mon
func BeginningOfMonth ¶
BeginningOfMonth 返回指定时间所在月的第0天 2013-11-01 00:00:00 Fri
func BeginningOfQuarter ¶
BeginningOfQuarter 返回指定时间所在季度的第0天 2013-10-01 00:00:00 Tue
func BeginningOfWeek ¶
BeginningOfWeek 返回指定时间所在周的第0天 2013-11-17 00:00:00 Sun
func BeginningOfYear ¶
BeginningOfYear 返回指定时间所在年的第0天 2013-01-01 00:00:00 Tue
func EndOfMinute ¶
EndOfMinute 返回指定时间的当前分钟的最后 2013-11-18 17:51:59.999999999 Mon
func EndOfMonth ¶
EndOfMonth 返回指定时间的当月的最后 2013-11-30 23:59:59.999999999 Sat
func EndOfQuarter ¶
EndOfQuarter 返回指定时间的当季度的最后 2013-12-31 23:59:59.999999999 Tue
func ToPGTimestamp ¶
ToPGTimestamp 格式化指定时间到 2006-01-02 15:04:05.999999-07 格式
func ToTimeAndDate2 ¶
ToTimeAndDate2 格式化指定时间到 2006-01-02 15:04:05 格式
func ToTimeAndDate2WithTimezone ¶
ToTimeAndDate2WithTimezone 格式化指定时间到 2006-01-02 15:04:05 -0700 MST 格式
Types ¶
This section is empty.