Last active
August 21, 2018 05:11
-
-
Save plutov/1c1370a2053bef979628d89bdf5e138c to your computer and use it in GitHub Desktop.
working-with-db-time-in-go2.go
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
db, err := sql.Open("mysql", "root:@/?parseTime=true") | |
var myTime time.Time | |
db.QueryRow("SELECT current_timestamp()").Scan(&myTime) | |
fmt.Println(myTime.Format(time.RFC3339)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment