[Qt-interest] QDateTime bug with <= operator ?

Merwin merwin.irc at gmail.com
Wed Feb 10 10:27:14 CET 2010


Thiago Macieira a écrit :
> Em Quarta-feira 10. Fevereiro 2010, às 10.05.44, Alexandre Beraud escreveu:
>   
>> Hi,
>>
>> QDateTime has milisecond precision (just like QTime). Can you check that
>> those are equal too ?
>>     
>
> Also check the timezone. If two dates have different time specifications 
> (universal or local), they have to be converted to universal for comparison.
>
>   
>> Merwin a écrit :
>>     
>>> Hi,
>>>
>>> I got a really strange thing that happens:
>>>
>>> qDebug() << beginOfTheYear << beginDate << (beginOfTheYear <= beginDate);
>>>
>>> Outputs:
>>>
>>> QDateTime("*mer. févr. 10 09:42:01 2010*") QDateTime("*mer. févr. 10
>>> 09:42:01 2010*") *false*
>>>
>>> As you can see, datetimes are equals, but the comparaison returns
>>> false... Is there a reason or it's a bug?
>>>
>>> --
>>> Merwin
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>       
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   
I checked that, they are both in LocalTime.



More information about the Qt-interest-old mailing list