Documentation
¶
Index ¶
- Constants
- func Range(start, end Date) iter.Seq[Date]
- func RangeWithIndex(start, end Date) iter.Seq2[Date, int]
- func Since(date Date) int
- func Until(date Date) int
- type Date
- func (d Date) Add(years int, months int, days int) Date
- func (d Date) After(date Date) bool
- func (d Date) AppendFormat(b []byte, layout string) []byte
- func (d Date) Before(date Date) bool
- func (d Date) Compare(date Date) int
- func (d Date) Day() int
- func (d Date) Equal(date Date) bool
- func (d Date) Format(layout string) string
- func (d *Date) GobDecode(data []byte) error
- func (d Date) GobEncode() ([]byte, error)
- func (d Date) ISOWeek() (int, int)
- func (d Date) IsZero() bool
- func (d Date) MarshalBinary() ([]byte, error)
- func (d Date) MarshalJSON() ([]byte, error)
- func (d Date) MarshalText() ([]byte, error)
- func (d Date) Month() time.Month
- func (d *Date) SetDay(day int)
- func (d *Date) SetMonth(month time.Month)
- func (d *Date) SetYear(year int)
- func (d Date) String() string
- func (d Date) Sub(date Date) int
- func (d Date) Time() time.Time
- func (d Date) TimeInLocation(loc *time.Location) time.Time
- func (d *Date) UnmarshalBinary(data []byte) error
- func (d *Date) UnmarshalJSON(data []byte) error
- func (d *Date) UnmarshalText(data []byte) error
- func (d Date) Weekday() time.Weekday
- func (d Date) YMD() (int, time.Month, int)
- func (d Date) Year() int
- func (d Date) YearDay() int
Constants ¶
const DefaultLayout = "2006-01-02"
DefaultLayout は日付のデフォルトフォーマットを定義します。
Variables ¶
This section is empty.
Functions ¶
func Range ¶ added in v1.1.0
Range は、指定された開始日(start)から終了日(end)までの連続した日付を生成するイテレータを返します。 イテレータには開始日(start)、終了日(end)を含みます。 `start` が `end` より前の場合は昇順に、後の場合は降順に日付を生成します。
func RangeWithIndex ¶ added in v1.4.0
RangeWithIndex は、指定された開始日(start)から終了日(end)までの日付と、そのインデックスを含むイテレータを返します。 イテレータには開始日(start)、終了日(end)を含みます。 `start` が `end` より前の場合は昇順に、後の場合は降順に日付を生成します。
Types ¶
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
Date は時刻情報を持たない日付を表します。
func (Date) AppendFormat ¶
AppendFormat は、指定されたレイアウトでフォーマットされた日付をバイトスライスに追加します。
func (Date) MarshalBinary ¶
MarshalBinary は、日付をバイナリ形式にエンコードします。
func (Date) MarshalJSON ¶
MarshalJSON は、日付を JSON 文字列にエンコードします。
func (Date) MarshalText ¶
MarshalText は、日付をテキスト形式にエンコードします。
func (Date) TimeInLocation ¶
TimeInLocation は、指定されたタイムゾーンの 0 時間 0 分 0 秒の time.Time を返します。
func (*Date) UnmarshalBinary ¶
UnmarshalBinary は、バイナリデータから日付をデコードします。
func (*Date) UnmarshalJSON ¶
UnmarshalJSON は、JSON 文字列から日付をデコードします。
func (*Date) UnmarshalText ¶
UnmarshalText は、テキストから日付をデコードします。