[CONJS-62] Support named timezones and daylight savings time Created: 2019-03-18 Updated: 2020-08-25 Resolved: 2019-04-25 |
|
| Status: | Closed |
| Project: | MariaDB Connector/node.js |
| Component/s: | other |
| Affects Version/s: | 2.0.3-GA |
| Fix Version/s: | 2.0.4 |
| Type: | Task | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
MariaDB Connector/node.JS only appears to have very limited timezone support at the moment:
https://mariadb.com/kb/en/library/nodejs-connection-options/#other-options The connector should also support named time zones, just as the server does. Otherwise, the connector can't handle daylight savings time. https://mariadb.com/kb/en/library/time-zones/#setting-the-time-zone It looks like time zones might currently be implemented this way because the connector tries to do a simplistic form of time zone conversions on its own: But why doesn't the connector just do SET SESSION time_zone = "..." and let the server handle the time zone conversions? |
| Comments |
| Comment by Diego Dupin [ 2019-04-25 ] |
|
Solution is not as simple as one can think : Best solution would be to automatically adjust driver to server timezone. Another solution would be as suggest to set SESSION time_zone, but that means filling time zone tables to be sure of results, and maintaining those data afterwhile.
Timezone standard exists, named IANA (aka Olson timezone database) with another standard for[ short time zone IDs|http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml] (aka bcp47) Best solution for now, that will be in next release is changing javascript date timezone client side, relying on moment-timezone.js that support IANA time zones. commit : https://github.com/MariaDB/mariadb-connector-nodejs/commit/d24c8ee99ac1ec380f650a0b304646587b4e2e20 |