Documentation ¶
Index ¶
- Constants
- type Date
- func (d Date) Add(year, month, day int) Date
- func (d Date) Day() int
- func (d Date) ISOWeek() (year, week int)
- func (d Date) Month() time.Month
- func (d Date) PreviousWeekday(day time.Weekday) Date
- func (d Date) String() string
- func (d Date) Time(hour, minute, second, nanosecond int, loc *time.Location) time.Time
- func (d Date) Weekday() time.Weekday
- func (d Date) Year() int
Constants ¶
const ( Min = -1 << 31 Max = 1<<31 - 1 )
Limits
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
type Date int32
Date represents a date with a resolution of one day.
func NewDate ¶
NewDate returns a Date in the specified location If the location is not specified UTC is assumed
func ParseDate ¶
ParseDate parses a formatted string and returns the value it represents. The layout defines the format by showing how the reference date
Mon Jan 2 2006
woud be represented. See the documentation of time.ParseInLocation for more in depth documentation.
func Today ¶
func Today() Date
Today returns the current date in your local timezone (see time.Now() for details).
func (Date) ISOWeek ¶
ISOWeek returns the ISO 8601 year and week number in which the date occurs. Week ranges from 1 to 53. Jan 01 to Jan 03 of year n might belong to week 52 or 53 of year n-1, and Dec 29 to Dec 31 might belong to week 1 of year n+1.
func (Date) PreviousWeekday ¶
PreviousWeekday returns the clostest previous date which is at the specified weekday.