QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
28 #include "qgis_core.h"
48 static const int YEARS = 31557600;
50 static const int MONTHS = 60 * 60 * 24 * 30;
52 static const int WEEKS = 60 * 60 * 24 * 7;
54 static const int DAY = 60 * 60 * 24;
56 static const int HOUR = 60 * 60;
58 static const int MINUTE = 60;
85 QgsInterval(
double years,
double months,
double weeks,
double days,
double hours,
double minutes,
double seconds );
109 void setYears(
double years );
121 double months()
const;
134 void setMonths(
double months );
145 double weeks()
const;
158 void setWeeks(
double weeks );
182 void setDays(
double days );
193 double hours()
const;
206 void setHours(
double hours );
217 double minutes()
const;
230 void setMinutes(
double minutes );
249 void setSeconds(
double seconds );
299 if ( !mValid && !other.mValid )
302 return mOriginalUnit == other.mOriginalUnit && mOriginalDuration == other.mOriginalDuration;
303 else if ( mValid && other.mValid )
311 return !( *
this == other );
319 static QgsInterval fromString(
const QString &
string );
322 operator QVariant()
const
324 return QVariant::fromValue( *
this );
330 double mSeconds = 0.0;
336 double mOriginalDuration = 0.0;
387 #endif // QGSINTERVAL_H
double seconds() const
Returns the interval duration in seconds.
double originalDuration() const
Returns the original interval duration.
QDebug CORE_EXPORT operator<<(QDebug dbg, const QgsInterval &interval)
Debug string representation of interval.
@ TemporalUnknownUnit
Unknown time unit.
bool operator==(QgsInterval other) const
TemporalUnit
Temporal units.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
bool operator!=(QgsInterval other) const
void setValid(bool valid)
Sets whether the interval is valid.
A representation of the interval between two datetime values.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
QgsInterval CORE_EXPORT operator-(const QDateTime &datetime1, const QDateTime &datetime2)
Returns the interval between two datetimes.
bool isValid() const
Returns true if the interval is valid.
QDateTime CORE_EXPORT operator+(const QDateTime &start, const QgsInterval &interval)
Adds an interval to a datetime.
QgsUnitTypes::TemporalUnit originalUnit() const
Returns the original interval temporal unit.