package now

Import Path
	github.com/jinzhu/now (on go.dev)

Dependency Relation
	imports 3 packages, and imported by one package

Involved Source Files
	d-> main.go
	    now.go

Exported Type Names

type Config (struct) Config configuration for now package TimeFormats []string TimeLocation *time.Location WeekStartDay time.Weekday (*T) MustParse(strs ...string) time.Time (*T) Parse(strs ...string) (time.Time, error) (*T) With(t time.Time) *Now var DefaultConfig *Config
type Now (struct) Now now struct Config *Config Config.TimeFormats []string Config.TimeLocation *time.Location Config.WeekStartDay time.Weekday Time time.Time (T) Add(d time.Duration) time.Time (T) AddDate(years int, months int, days int) time.Time (T) After(u time.Time) bool (T) AppendFormat(b []byte, layout string) []byte (T) Before(u time.Time) bool (*T) BeginningOfDay() time.Time (*T) BeginningOfHalf() time.Time (*T) BeginningOfHour() time.Time (*T) BeginningOfMinute() time.Time (*T) BeginningOfMonth() time.Time (*T) BeginningOfQuarter() time.Time (*T) BeginningOfWeek() time.Time (*T) BeginningOfYear() time.Time (*T) Between(begin, end string) bool (T) Clock() (hour, min, sec int) (T) Date() (year int, month time.Month, day int) (T) Day() int (*T) EndOfDay() time.Time (*T) EndOfHalf() time.Time (*T) EndOfHour() time.Time (*T) EndOfMinute() time.Time (*T) EndOfMonth() time.Time (*T) EndOfQuarter() time.Time (*T) EndOfSunday() time.Time (*T) EndOfWeek() time.Time (*T) EndOfYear() time.Time (T) Equal(u time.Time) bool (T) Format(layout string) string (*T) GobDecode(data []byte) error (T) GobEncode() ([]byte, error) (T) Hour() int (T) ISOWeek() (year, week int) (T) In(loc *time.Location) time.Time (T) IsZero() bool (T) Local() time.Time (T) Location() *time.Location (T) MarshalBinary() ([]byte, error) (T) MarshalJSON() ([]byte, error) (T) MarshalText() ([]byte, error) (T) Minute() int (*T) Monday() time.Time (T) Month() time.Month (*T) MustParse(strs ...string) (t time.Time) (T) Nanosecond() int (*T) Parse(strs ...string) (t time.Time, err error) (T) Round(d time.Duration) time.Time (T) Second() int (T) String() string (T) Sub(u time.Time) time.Duration (*T) Sunday() time.Time (T) Truncate(d time.Duration) time.Time (T) UTC() time.Time (T) Unix() int64 (T) UnixNano() int64 (*T) UnmarshalBinary(data []byte) error (*T) UnmarshalJSON(data []byte) error (*T) UnmarshalText(data []byte) error (T) Weekday() time.Weekday (T) With(t time.Time) *Now (T) Year() int (T) YearDay() int (T) Zone() (name string, offset int) T : encoding.BinaryMarshaler *T : encoding.BinaryUnmarshaler T : encoding.TextMarshaler *T : encoding.TextUnmarshaler T : encoding/json.Marshaler *T : encoding/json.Unmarshaler T : fmt.Stringer func New(t time.Time) *Now func With(t time.Time) *Now func (*Config).With(t time.Time) *Now
Exported Values
func BeginningOfDay() time.Time BeginningOfDay beginning of day
func BeginningOfHour() time.Time BeginningOfHour beginning of hour
func BeginningOfMinute() time.Time BeginningOfMinute beginning of minute
func BeginningOfMonth() time.Time BeginningOfMonth beginning of month
func BeginningOfQuarter() time.Time BeginningOfQuarter beginning of quarter
func BeginningOfWeek() time.Time BeginningOfWeek beginning of week
func BeginningOfYear() time.Time BeginningOfYear beginning of year
func Between(time1, time2 string) bool Between check now between the begin, end time or not
var DefaultConfig *Config DefaultConfig default config
func EndOfDay() time.Time EndOfDay end of day
func EndOfHour() time.Time EndOfHour end of hour
func EndOfMinute() time.Time EndOfMinute end of minute
func EndOfMonth() time.Time EndOfMonth end of month
func EndOfQuarter() time.Time EndOfQuarter end of quarter
func EndOfSunday() time.Time EndOfSunday end of sunday
func EndOfWeek() time.Time EndOfWeek end of week
func EndOfYear() time.Time EndOfYear end of year
func Monday() time.Time Monday monday
func MustParse(strs ...string) time.Time MustParse must parse string to time or will panic
func MustParseInLocation(loc *time.Location, strs ...string) time.Time MustParseInLocation must parse string to time in location or will panic
func New(t time.Time) *Now New initialize Now with time
func Parse(strs ...string) (time.Time, error) Parse parse string to time
func ParseInLocation(loc *time.Location, strs ...string) (time.Time, error) ParseInLocation parse string to time in location
func Sunday() time.Time Sunday sunday
var TimeFormats []string TimeFormats default time formats will be parsed as
var WeekStartDay time.Weekday WeekStartDay set week start day, default is sunday
func With(t time.Time) *Now With initialize Now with time