[Qt-interest] How calculate time span (days, hours, minutes) QDateTime difference?

Andre Somers andre at familiesomers.nl
Sat Jun 12 16:50:02 CEST 2010


Op 12-6-2010 9:18, Andre Somers schreef:
>
> There are more issues to considder of course...
>
>    
One that is interesting is how to deal with years (and months) as a 
unit. The difference between the same date on two years may be 365 or 
366 days. Still, you expect the difference to be one year, while 366 
days for another year may be a year and a day. So I guess a QTimeSpan 
class would need to actually keep track of the dates it is the 
difference of, if it is to be able to work with years. Otherwise, it 
should stick with weeks as the maximum unit of time.

André



More information about the Qt-interest-old mailing list