QTimeSpan: interest?
-
With DST (and respectivly 23/25 h days) QDateTiem has a problem, and afaik it's not fixed up to now.
You do not get out of QDateTime it its the first 2 o'clock in the morning or the second one :-( (DST in Germany happens at 3 o'clock with a switch back to 2 o'clock, so you have 2 o'clock two times that day).
Same applies to the QDateTimeEdit, there you don't know, which of the two you set by setting 2:30 ...
-
Nice class. Voted for it.
-
@Gerolf:
So, the problem is, that 02:30 on the date the clock goes back an hour is simply an ambigous time. I am not sure there is anything you can do about that, other than specifying the time in UTC instead. There are "bugreports":http://bugreports.qt.nokia.com/browse/QTBUG-10219 in Jira to ask for a better support for timezones in QDateTime. -
Great work. I voted for it because I needed this a while ago, and for sure I will need it in the future.
-
A timespan has some pitfalls:
If it uses walltime as the two reference points, you must handle cases where start time is actually after end time. This is because there system time can be updated from a time source (and might jump back in time). IIRC on cell phones this happens quite often, but it can also happen if your desktop system is connected to a NTP time source. It can also happen if you are not connected to a external time source, for instance due to DST changes.
This is also mentioned in the documentation for QTime::elapsed(), which is often used for the same purpose. (actually it says that the result is undefined) -
voted too
-
I need this class, seems to be very useful!!!
-
Hello Andre,
I think QTimeSpan class is really a missing part of the Qt Project. Thanks for yours and Sean's efforts!
I have a question regarding the legality. Is it possible to use your sources in a commercial project (we use Qt with LGPL) as a part of a code-base (do not incorporate it to the Qt libs) before it becomes a part of Qt officially?
Thanks!UPD: English has been slightly improved.
-
Please update Qt bug report link to https://bugreports.qt.io/browse/QTBUG-16556