Last active
November 26, 2017 02:30
-
-
Save yyano/82467d30b0260a1acf76169ad8d49597 to your computer and use it in GitHub Desktop.
Go言語で日付のループ処理。2015年12月01日から今日までを1日ずつ表示する。 Loop by date.(from 01 dec 2015, to Today)
This file contains 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 ( | |
"log" | |
"time" | |
) | |
func main() { | |
time.Parse("2006-01-02", "2015-12-01") | |
for d := fromDate; d.Unix() < time.Now().Unix(); d = d.AddDate(0, 0, 1) { | |
log.Println(d) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment