Time zones (again)

Linus Torvalds torvalds at linux-foundation.org
Tue Jun 21 01:09:16 PDT 2016


On Jun 21, 2016 00:57, "Robert Helling" <helling at atdotde.de> wrote:
>
> In order to make conversion between QDateTime and time_t simpler
> (actually trivial), let’s set all the Qt stuff to be in Qt::UTC.

Yes. I did that to some of the time handling functions already, and removed
some of the odd timezone handling that way. See commit 56ed3f1c6119b for an
example.

However, not all of the time handling functions seem to always accept a
time zone. So sometimes you end up having to pick another helper function
than the one you'd naively prefer, just to get one that takes a timezone
argument (that you can then set to Qt::UTC).

The "fromTime_t()" function was an example of such a case : ostensibly the
right thing to use (converts from a time_t, which was exactly what we
wanted) but doesn't take a timezone input.

Of course, "fromTime_t()" was then also completely broken in that it
limited the input to an unsigned integer, which was just incredibly broken
and doesn't actually match time_t at all. So the whole function was just
shit. But there may be similar gotchas elsewhere.

      Linus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160621/79989f95/attachment.html>


More information about the subsurface mailing list