A representation of the interval between two datetime values.
More...
#include <qgsinterval.h>
|
| static const int | DAY = 60 * 60 * 24 |
| | Seconds per day. More...
|
| |
| static const int | HOUR = 60 * 60 |
| | Seconds per hour. More...
|
| |
| static const int | MINUTE = 60 |
| | Seconds per minute. More...
|
| |
| static const int | MONTHS = 60 * 60 * 24 * 30 |
| | Seconds per month, based on 30 day month. More...
|
| |
| static const int | WEEKS = 60 * 60 * 24 * 7 |
| | Seconds per week. More...
|
| |
| static const int | YEARS = 31557600 |
| | Seconds per year (average) More...
|
| |
A representation of the interval between two datetime values.
- Since
- QGIS 2.16
Definition at line 39 of file qgsinterval.h.
◆ QgsInterval() [1/2]
| QgsInterval::QgsInterval |
( |
| ) |
|
|
default |
Default constructor for QgsInterval.
Creates an invalid interval.
◆ QgsInterval() [2/2]
| QgsInterval::QgsInterval |
( |
double |
seconds | ) |
|
◆ days()
| double QgsInterval::days |
( |
| ) |
const |
|
inline |
◆ fromString()
| QgsInterval QgsInterval::fromString |
( |
const QString & |
string | ) |
|
|
static |
Converts a string to an interval.
- Parameters
-
- Returns
- interval, or invalid interval if string could not be parsed
Definition at line 46 of file qgsinterval.cpp.
◆ hours()
| double QgsInterval::hours |
( |
| ) |
const |
|
inline |
◆ isValid()
| bool QgsInterval::isValid |
( |
| ) |
const |
|
inline |
◆ minutes()
| double QgsInterval::minutes |
( |
| ) |
const |
|
inline |
◆ months()
| double QgsInterval::months |
( |
| ) |
const |
|
inline |
Returns the interval duration in months (based on a 30 day month).
- See also
- setMonths()
Definition at line 86 of file qgsinterval.h.
◆ operator QVariant()
| QgsInterval::operator QVariant |
( |
| ) |
const |
|
inline |
Allows direct construction of QVariants from intervals.
Definition at line 183 of file qgsinterval.h.
◆ operator==()
| bool QgsInterval::operator== |
( |
QgsInterval |
other | ) |
const |
◆ seconds()
| double QgsInterval::seconds |
( |
| ) |
const |
|
inline |
◆ setDays()
| void QgsInterval::setDays |
( |
double |
days | ) |
|
|
inline |
◆ setHours()
| void QgsInterval::setHours |
( |
double |
hours | ) |
|
|
inline |
◆ setMinutes()
| void QgsInterval::setMinutes |
( |
double |
minutes | ) |
|
|
inline |
Sets the interval duration in minutes.
- Parameters
-
| minutes | duration in minutes |
- See also
- minutes()
Definition at line 145 of file qgsinterval.h.
◆ setMonths()
| void QgsInterval::setMonths |
( |
double |
months | ) |
|
|
inline |
Sets the interval duration in months.
- Parameters
-
| months | duration in months (based on a 30 day month) |
- See also
- months()
Definition at line 93 of file qgsinterval.h.
◆ setSeconds()
| void QgsInterval::setSeconds |
( |
double |
seconds | ) |
|
|
inline |
Sets the interval duration in seconds.
- Parameters
-
| seconds | duration in seconds |
- See also
- seconds()
Definition at line 158 of file qgsinterval.h.
◆ setValid()
| void QgsInterval::setValid |
( |
bool |
valid | ) |
|
|
inline |
Sets whether the interval is valid.
- Parameters
-
| valid | set to true to set the interval as valid. |
- See also
- isValid()
Definition at line 171 of file qgsinterval.h.
◆ setWeeks()
| void QgsInterval::setWeeks |
( |
double |
weeks | ) |
|
|
inline |
◆ setYears()
| void QgsInterval::setYears |
( |
double |
years | ) |
|
|
inline |
Sets the interval duration in years.
- Parameters
-
| years | duration in years (based on average year length) |
- See also
- years()
Definition at line 80 of file qgsinterval.h.
◆ weeks()
| double QgsInterval::weeks |
( |
| ) |
const |
|
inline |
◆ years()
| double QgsInterval::years |
( |
| ) |
const |
|
inline |
Returns the interval duration in years (based on an average year length)
- See also
- setYears()
Definition at line 73 of file qgsinterval.h.
◆ DAY
| const int QgsInterval::DAY = 60 * 60 * 24 |
|
static |
◆ HOUR
| const int QgsInterval::HOUR = 60 * 60 |
|
static |
◆ MINUTE
| const int QgsInterval::MINUTE = 60 |
|
static |
◆ MONTHS
| const int QgsInterval::MONTHS = 60 * 60 * 24 * 30 |
|
static |
Seconds per month, based on 30 day month.
Definition at line 48 of file qgsinterval.h.
◆ WEEKS
| const int QgsInterval::WEEKS = 60 * 60 * 24 * 7 |
|
static |
◆ YEARS
| const int QgsInterval::YEARS = 31557600 |
|
static |
The documentation for this class was generated from the following files: