[Qt-interest] Strange problem storing and retrieving and comparing QTime/QDataTime

Julien Cugnière julien.cugniere at gmail.com
Tue Nov 17 11:49:22 CET 2009


2009/11/17 Mihail Naydenov <mlists at ymail.com>
> Also *only the QTime part fails*! This is
>
>  lastmod.date() == currlastmod.date()
>
> also passes, but lastmod.time() == currlastmod.time() does not.
> (Again if I toString() them they pass)

Check lastmod.timeSpec() and currlastmod.timeSpec(). Probably one is
local and the other UTC. If this is the problem, then you should
probably use toLocal() or toUTC() on the dates you read from the
database, to ensure that they're in the same timeSpec as used in the
rest of your application.

--
Julien Cugnière




More information about the Qt-interest-old mailing list