From 760d5acbbe2aa9d9611a7ae621e1d3c0e643ea3a Mon Sep 17 00:00:00 2001 From: Tim Ruffles Date: Mon, 4 Mar 2019 08:17:37 -0600 Subject: [PATCH 1/2] Equivalent is clearer --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 341d9194c..999ff4c2c 100644 --- a/README.md +++ b/README.md @@ -444,7 +444,7 @@ See the [godoc of Go-MySQL-Driver](https://godoc.org/github.com/go-sql-driver/my ### `time.Time` support The default internal output type of MySQL `DATE` and `DATETIME` values is `[]byte` which allows you to scan the value into a `[]byte`, `string` or `sql.RawBytes` variable in your program. -However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` variables, which is the logical opposite in Go to `DATE` and `DATETIME` in MySQL. You can do that by changing the internal output type from `[]byte` to `time.Time` with the DSN parameter `parseTime=true`. You can set the default [`time.Time` location](https://golang.org/pkg/time/#Location) with the `loc` DSN parameter. +However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` variables, which is the logical equivalent in Go to `DATE` and `DATETIME` in MySQL. You can do that by changing the internal output type from `[]byte` to `time.Time` with the DSN parameter `parseTime=true`. You can set the default [`time.Time` location](https://golang.org/pkg/time/#Location) with the `loc` DSN parameter. **Caution:** As of Go 1.1, this makes `time.Time` the only variable type you can scan `DATE` and `DATETIME` values into. This breaks for example [`sql.RawBytes` support](https://github.com/go-sql-driver/mysql/wiki/Examples#rawbytes). From 3db45f66dfb1eb7ca3b0dbbabcc8ebebec1c4dc2 Mon Sep 17 00:00:00 2001 From: Tim Ruffles Date: Mon, 4 Mar 2019 08:32:53 -0600 Subject: [PATCH 2/2] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 5482a8536..146cdffdd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -77,6 +77,7 @@ Stan Putrya Stanley Gunawan Steven Hartland Thomas Wodarek +Tim Ruffles Tom Jenkinson Xiangyu Hu Xiaobing Jiang