Skip to content

Commit 57af768

Browse files
committed
Merge pull request #337 from soroushjp/sjp-readme-timezone
Expanded README around difference between loc and time_zone params
2 parents a197e5d + e6cb533 commit 57af768

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Luke Scott <luke at webconnex.com>
3131
Michael Woolnough <michael.woolnough at gmail.com>
3232
Nicola Peduzzi <thenikso at gmail.com>
3333
Runrioter Wung <runrioter at gmail.com>
34+
Soroush Pour <me at soroushjp.com>
3435
Xiaobing Jiang <s7v7nislands at gmail.com>
3536
Xiuming Chen <cc at cxm.cc>
3637

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ Default: UTC
205205

206206
Sets the location for time.Time values (when using `parseTime=true`). *"Local"* sets the system's location. See [time.LoadLocation](http://golang.org/pkg/time/#LoadLocation) for details.
207207

208+
Note that this sets the location for time.Time values but does not change MySQL's [time_zone setting](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html). For that see the [time_zone system variable](#system-variables), which can also be set as a DSN parameter.
209+
208210
Please keep in mind, that param values must be [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape)'ed. Alternatively you can manually replace the `/` with `%2F`. For example `US/Pacific` would be `loc=US%2FPacific`.
209211

210212

@@ -257,7 +259,7 @@ Default: false
257259

258260
All other parameters are interpreted as system variables:
259261
* `autocommit`: `"SET autocommit=<value>"`
260-
* `time_zone`: `"SET time_zone=<value>"`
262+
* [`time_zone`](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html): `"SET time_zone=<value>"`
261263
* [`tx_isolation`](https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tx_isolation): `"SET tx_isolation=<value>"`
262264
* `param`: `"SET <param>=<value>"`
263265

0 commit comments

Comments
 (0)