doc: add doc for DayOfYear

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

No files matched your search

+20
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
}