Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,18 @@ import (

// 時間を表示する簡単なgo言語のプログラム
func main() {
fmt.Println("The time is", time.Now())
now := time.Now()
fmt.Println("The time is", now)

// 7日後の時刻
future7 := now.AddDate(0, 0, 7)
fmt.Println("7日後の時刻は", future7)

// 10日後の時刻
future10 := now.AddDate(0, 0, 10)
fmt.Println("10日後の時刻は", future10)

// 14日後の時刻
future14 := now.AddDate(0, 0, 14)
fmt.Println("14日後の時刻は", future14)
}