3 bool Timestamp::operator<(const Timestamp
&other
) const {
4 return internal_time
< other
.internal_time
;
7 bool Timestamp::operator<=(const Timestamp
&other
) const {
8 return internal_time
<= other
.internal_time
;
11 bool Timestamp::operator>(const Timestamp
&other
) const {
12 return internal_time
> other
.internal_time
;
15 bool Timestamp::operator>=(const Timestamp
&other
) const {
16 return internal_time
>= other
.internal_time
;
19 bool Timestamp::operator==(const Timestamp
&other
) const {
20 return internal_time
== other
.internal_time
;
23 Timestamp
&Timestamp::operator=(const Timestamp
&other
) {
24 internal_time
= other
.internal_time
;
28 qint64
Timestamp::seconds_until(const Timestamp
& other
) const {
29 return internal_time
.secsTo(other
.internal_time
);
32 qint64
Timestamp::ms_until(const Timestamp
& other
) const {
33 /*qint64 seconds = seconds_until(other);*/
34 QTime this_time
= internal_time
.time();
35 QTime other_time
= other
.internal_time
.time();
38 if(this_time
<= other_time
) return this_time
.msecsTo(other_time
);
39 else qCritical("NOTE: comparision between different-day QTimes NYI! (1)");
41 else if(*this >= other
) {
42 if(this_time
>= other_time
) return -other_time
.msecsTo(this_time
);
43 else qCritical("NOTE: comparision between different-day QTimes NYI! (2)");
48 void Timestamp::add_ms(qint64 ms
) {
49 internal_time
= internal_time
.addMSecs(ms
);
52 QString
Timestamp::to_string() const {
53 return internal_time
.toString();