Created
January 6, 2020 07:17
-
-
Save 178inaba/8a1d0e9353c14c4aa3e3d603e1166d7e 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() { | |
| t := time.Now() | |
| for i := 0; i < 100; i++ { | |
| fmt.Println(t.Year(), t.Month()) | |
| t = t.AddDate(0, 1, 0) | |
| fmt.Println(t) | |
| fmt.Println(t.Year(), t.Month()) | |
| fmt.Println("----------------------------------------------") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment