Created
January 6, 2020 05:24
-
-
Save 178inaba/8cbce2d3546d59e66455d4b03b27d300 to your computer and use it in GitHub Desktop.
year, month increment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
y, m := 2019, time.Month(10) | |
for i := 0; i < 100; i++ { | |
fmt.Println(y, m) | |
t := time.Date(y, m+1, 1, 0, 0, 0, 0, time.UTC) | |
fmt.Println(t) | |
y, m, _ = t.Date() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment