Documentation ¶
Index ¶
- Variables
- func BeginningOfDay() time.Time
- func BeginningOfHour() time.Time
- func BeginningOfMinute() time.Time
- func BeginningOfMonth() time.Time
- func BeginningOfQuarter() time.Time
- func BeginningOfWeek() time.Time
- func BeginningOfYear() time.Time
- func Between(time1, time2 string) bool
- func EndOfDay() time.Time
- func EndOfHour() time.Time
- func EndOfMinute() time.Time
- func EndOfMonth() time.Time
- func EndOfQuarter() time.Time
- func EndOfSunday() time.Time
- func EndOfWeek() time.Time
- func EndOfYear() time.Time
- func Monday(strs ...string) time.Time
- func MustParse(strs ...string) time.Time
- func MustParseInLocation(loc *time.Location, strs ...string) time.Time
- func Parse(strs ...string) (time.Time, error)
- func ParseInLocation(loc *time.Location, strs ...string) (time.Time, error)
- func Quarter() uint
- func Sunday(strs ...string) time.Time
- type Config
- type When
- func (now *When) BeginningOfDay() time.Time
- func (now *When) BeginningOfHalf() time.Time
- func (now *When) BeginningOfHour() time.Time
- func (now *When) BeginningOfMinute() time.Time
- func (now *When) BeginningOfMonth() time.Time
- func (now *When) BeginningOfQuarter() time.Time
- func (now *When) BeginningOfWeek() time.Time
- func (now *When) BeginningOfYear() time.Time
- func (now *When) Between(begin, end string) bool
- func (now *When) EndOfDay() time.Time
- func (now *When) EndOfHalf() time.Time
- func (now *When) EndOfHour() time.Time
- func (now *When) EndOfMinute() time.Time
- func (now *When) EndOfMonth() time.Time
- func (now *When) EndOfQuarter() time.Time
- func (now *When) EndOfSunday() time.Time
- func (now *When) EndOfWeek() time.Time
- func (now *When) EndOfYear() time.Time
- func (now *When) Monday(strs ...string) time.Time
- func (now *When) MustParse(strs ...string) (t time.Time)
- func (now *When) Parse(strs ...string) (t time.Time, err error)
- func (now *When) Quarter() uint
- func (now *When) Sunday(strs ...string) time.Time
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeFormats = []string{ "2006", "2006-1", "2006-1-2", "2006-1-2 15", "2006-1-2 15:4", "2006-1-2 15:4:5", "1-2", "15:4:5", "15:4", "15", "15:4:5 Jan 2, 2006 MST", "2006-01-02 15:04:05.999999999 -0700 MST", "2006-01-02T15:04:05Z0700", "2006-01-02T15:04:05Z07", "2006.1.2", "2006.1.2 15:04:05", "2006.01.02", "2006.01.02 15:04:05", "2006.01.02 15:04:05.999999999", "1/2/2006", "1/2/2006 15:4:5", "2006/01/02", "20060102", "2006/01/02 15:04:05", time.ANSIC, time.UnixDate, time.RubyDate, time.RFC822, time.RFC822Z, time.RFC850, time.RFC1123, time.RFC1123Z, time.RFC3339, time.RFC3339Nano, time.Kitchen, time.Stamp, time.StampMilli, time.StampMicro, time.StampNano, }
TimeFormats default time formats will be parsed as
View Source
var WeekStartDay = time.Sunday
WeekStartDay set week start day, default is sunday
Functions ¶
func BeginningOfQuarter ¶
BeginningOfQuarter beginning of quarter
func MustParseInLocation ¶
MustParseInLocation must parse string to time in location or will panic
func ParseInLocation ¶
ParseInLocation parse string to time in location
Types ¶
type Config ¶
Config configuration for now package
var DefaultConfig *Config
DefaultConfig default config
type When ¶
Now now struct
func (*When) BeginningOfDay ¶
BeginningOfDay beginning of day
func (*When) BeginningOfHalf ¶
BeginningOfHalf beginning of half year
func (*When) BeginningOfHour ¶
BeginningOfHour beginning of hour
func (*When) BeginningOfMinute ¶
BeginningOfMinute beginning of minute
func (*When) BeginningOfMonth ¶
BeginningOfMonth beginning of month
func (*When) BeginningOfQuarter ¶
BeginningOfQuarter beginning of quarter
func (*When) BeginningOfWeek ¶
BeginningOfWeek beginning of week
func (*When) BeginningOfYear ¶
BeginningOfYear BeginningOfYear beginning of year
Click to show internal directories.
Click to hide internal directories.