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:
Solution is not as simple as one can think :
Issue is when Node.js current timezone differ to server timezone, causing timestamp shift.
Best solution would be to automatically adjust driver to server timezone.
Problem is that server default behaviour rely on operating system.
For Linux that means posix / Olson time. For windows, its own implementation called Microsoft Time Zone Database.
So different standard, and driver cannot even rely on what server send on system_time_zone : on windows, results are localized 'Romance Standard Time' on a french installation will result in 'Paris, Madrid (heure d’été' (not even talking of mysql implementation that doesn't even parse as utf8 => 'Paris, Madrid (heure d??t')
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.
MDEV-19243 is created to unify implementation server side.
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.
Diego Dupin
added a comment - - edited Solution is not as simple as one can think :
Issue is when Node.js current timezone differ to server timezone, causing timestamp shift.
Best solution would be to automatically adjust driver to server timezone.
Problem is that server default behaviour rely on operating system.
For Linux that means posix / Olson time. For windows, its own implementation called Microsoft Time Zone Database.
So different standard, and driver cannot even rely on what server send on system_time_zone : on windows, results are localized 'Romance Standard Time' on a french installation will result in 'Paris, Madrid (heure d’été' (not even talking of mysql implementation that doesn't even parse as utf8 => 'Paris, Madrid (heure d??t')
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.
MDEV-19243 is created to unify implementation server side.
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
Solution is not as simple as one can think :
Issue is when Node.js current timezone differ to server timezone, causing timestamp shift.
Best solution would be to automatically adjust driver to server timezone.
Problem is that server default behaviour rely on operating system.
For Linux that means posix / Olson time. For windows, its own implementation called Microsoft Time Zone Database.
So different standard, and driver cannot even rely on what server send on system_time_zone : on windows, results are localized 'Romance Standard Time' on a french installation will result in 'Paris, Madrid (heure d’été' (not even talking of mysql implementation that doesn't even parse as utf8 => 'Paris, Madrid (heure d??t')
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.
MDEV-19243is created to unify implementation server side.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