Skip to content

Instantly share code, notes, and snippets.

@plutov
Last active August 21, 2018 05:11
Show Gist options
  • Save plutov/1c1370a2053bef979628d89bdf5e138c to your computer and use it in GitHub Desktop.
Save plutov/1c1370a2053bef979628d89bdf5e138c to your computer and use it in GitHub Desktop.
working-with-db-time-in-go2.go
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