Skip to content

Commit 2c9d54f

Browse files
Tim Rufflesjulienschmidt
Tim Ruffles
authored andcommitted
README: 'Equivalent' is clearer (go-sql-driver#927)
* Equivalent is clearer * Update AUTHORS
1 parent 972a708 commit 2c9d54f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Stan Putrya <root.vagner at gmail.com>
7777
Stanley Gunawan <gunawan.stanley at gmail.com>
7878
Steven Hartland <steven.hartland at multiplay.co.uk>
7979
Thomas Wodarek <wodarekwebpage at gmail.com>
80+
Tim Ruffles <timruffles at gmail.com>
8081
Tom Jenkinson <tom at tjenkinson.me>
8182
Xiangyu Hu <xiangyu.hu at outlook.com>
8283
Xiaobing Jiang <s7v7nislands at gmail.com>

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ See the [godoc of Go-MySQL-Driver](https://godoc.org/github.com/go-sql-driver/my
444444
### `time.Time` support
445445
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.
446446

447-
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.
447+
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.
448448

449449
**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).
450450

0 commit comments

Comments
 (0)