Last active
October 30, 2020 11:18
-
-
Save alissonbrunosa/29e95256e83fd2d74983ac91654724cc to your computer and use it in GitHub Desktop.
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 ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
today := time.Now() | |
future := today.AddDate(0, 4, 0) | |
fmt.Println("Today:", today) | |
fmt.Println("Future:", future) | |
fmt.Println("Difference in days:", future.Sub(today).Hours()/24) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment