1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 06:32:28 +08:00

doc: add doc for DayOfYear

This commit is contained in:
dudaodong
2023-05-31 10:04:59 +08:00
parent 46ecb117a5
commit 09ec5b97a6
5 changed files with 156 additions and 48 deletions

View File

@@ -369,3 +369,23 @@ func ExampleBetweenSeconds() {
// 86400
// -86400
}
func ExampleDayOfYear() {
date1 := time.Date(2023, 02, 01, 1, 1, 1, 0, time.Local)
result1 := DayOfYear(date1)
date2 := time.Date(2023, 01, 02, 1, 1, 1, 0, time.Local)
result2 := DayOfYear(date2)
date3 := time.Date(2023, 01, 01, 1, 1, 1, 0, time.Local)
result3 := DayOfYear(date3)
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
// Output:
// 31
// 1
// 0
}