Fix daylight savings code on Windows altogether
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 27 Jun 2013 12:04:08 +0000 (14:04 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 27 Jun 2013 16:16:43 +0000 (18:16 +0200)
commit73649e80c03872851f3b5ad96e061d1b347612b5
tree2de08d79608bb090ac9378d21e09c3ba614858dc
parent36d45a1585d3ed67f28d23d3f619aca1fe61a013
Fix daylight savings code on Windows altogether

Reverted the previous change, the local timezone adjustment should not include
the daylight savings, because in a long running program that runs across the
DST boundary, the timezone doesn't change, but the DST adjustment does. That
is why LocalTZA is always used in conjunction with a call to DaylightSavingTA,
which unfortunately had a silly bug on Windows:

It was assumed that _localtime64_s returns zero on failure, similar to
localtime_r on Unix. However it is exactly the opposite, zero is returned
on success and an error code is returned on failure.

Change-Id: Ib324f09f290870630b66793882c5b121de445f05
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4/qv4dateobject.cpp