github.com/go-chrono/chrono@v0.0.0-20240102183611-532f0d0d7c34/docs/Functions.md (about) 1 # Functions 2 3 The table below shows the functions attached to the primary date and time types of `chrono`. Where a function returns a `chrono` type, that type is specified. 4 5 | | `LocalDate` | `LocalTime` | `LocalDateTime` | `OffsetTime` | `OffsetDateTime` | 6 | ---------------------------------------------- | :---------: | :---------: | :----------------------: | :----------: | :-----------------------: | 7 | **`Date() (year int, month Month, day int)`** | 🗸 | | | | | 8 | **`IsLeapYear() bool`** | 🗸 | | | | | 9 | **`Weekday() Weekday`** | 🗸 | | | | | 10 | **`YearDay() int`** | 🗸 | | | | | 11 | **`ISOWeek() (isoYear, isoWeek int)`** | 🗸 | | | | | 12 | **`Clock() (hour, min, sec int)`** | | 🗸 | | 🗸 | | 13 | **`Nanosecond() int`** | | 🗸 | | 🗸 | | 14 | **`BusinessHour() int`** | | 🗸 | | 🗸 | | 15 | **`Offset() Offset`** | | | | 🗸 | 🗸 | 16 | **`Split() ...`** | | | `LocalDate`, `LocalTime` | | `LocalDate`, `OffsetTime` | 17 | **`Local() ...`** | | | | `LocalTime` | `LocalDateTime` | 18 | **`In() ...`** | | | | `LocalTime` | `OffsetDateTime` | 19 | **`UTC() ...`** | | | | `LocalTime` | `OffsetDateTime` | 20 | **`Sub() ...`** | | 🗸 | 🗸 | 🗸 | 🗸 | 21 | **`Add(...) ...`** | | `LocalTime` | `LocalDateTime` | `LocalTime` | `OffsetDateTime` | 22 | **`CanAdd(...) bool`** | | 🗸 | 🗸 | 🗸 | 🗸 | 23 | **`AddDate(years, months, days int) ...`** | `LocalDate` | | `LocalDateTime` | | `OffsetDateTime` | 24 | **`CanAddDate(years, months, days int) bool`** | 🗸 | | 🗸 | | 🗸 | 25 | **`Format(layout string) string`** | 🗸 | 🗸 | 🗸 | 🗸 | 🗸 | 26 | **`Parse(layout, value string) error`** | 🗸 | 🗸 | 🗸 | 🗸 | 🗸 |