Documentation
¶
Index ¶
- func Since(d Date) int64
- type Date
- func (d Date) AddDate(years int, months int, days int) Date
- func (d Date) AddDays(value int) Date
- func (d Date) After(u Date) bool
- func (d Date) Before(u Date) bool
- func (d Date) Day() int
- func (d Date) Equal(u Date) bool
- func (d Date) Month() time.Month
- func (d Date) String() string
- func (d Date) Sub(u Date) int
- func (d Date) ToTime(hour, min, sec, nsec int, loc *time.Location) time.Time
- func (d Date) Weekday() time.Weekday
- func (d Date) Year() int
- func (d Date) YearDay() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Date ¶
type Date int64
Represents dates with values from January 1, 0001 Anno Domini (Common Era) through December 31, 9999 A.D (C.E) in Gregorian calendar.
func Parse ¶
Parse parses a formatted string and returns the date value it represents. See the documentation for the constant called Layout to see how to represent the format. The second argument must be parseable using the format string (layout) provided as the first argument.
func (Date) AddDate ¶
AddDate returns the date corresponding to adding the given number of years, months, and days to t. For example, AddDate(-1, 2, 3) applied to January 1, 2011 returns March 4, 2010.
AddDate normalizes its result in the same way that Date does, so, for example, adding one month to October 31 yields December 1, the normalized form for November 31.