Documentation ¶
Overview ¶
Package ratadie represents calendar dates as fixed integers, as specified in Dershowitz and Reingold's Calendrical Calculations.
Index ¶
- type Day
- func (rd Day) Date() (year int, month time.Month, day int)
- func (rd Day) Format(layout string) string
- func (rd Day) MarshalText() ([]byte, error)
- func (rd Day) Time() time.Time
- func (rd Day) TimeIn(loc *time.Location) time.Time
- func (rd *Day) UnmarshalText(b []byte) error
- func (rd Day) Weekday() time.Weekday
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Day ¶
type Day int32
A Day represents a given calendar date as a fixed integer, as specified in Dershowitz and Reingold's Calendrical Calculations. Day(1) is Jan 1 of year 1 in the proleptic Gregorian calendar. Representable dates range from Jun 22, -5879610 to Jul 11, 5879611.
func Date ¶
Date returns the Day for the given year, month, and day. The result of passing out-of-range month or day values is undefined. Do not use this function for month arithmetic.
func Parse ¶
Parse parses a formatted string and returns the day value it represents. It is a convenience wrapper around time.Parse.
Note that time and location may be specified in the format, but are completely ignored.
func Time ¶
Time is equivalent to calling Date(t.Date()). Note that time and location are completely ignored.
func (Day) MarshalText ¶ added in v1.1.0
MarshalText implements encoding.TextMarshaler.
func (Day) TimeIn ¶
TimeIn returns a time value for midnight in the given location on the day represented by rd.
func (*Day) UnmarshalText ¶ added in v1.1.0
UnmarshalText implements encoding.TextUnmarshaler.