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.
- Note
- Added in version 2.16
Definition at line 34 of file qgsinterval.h.
◆ QgsInterval() [1/2]
QgsInterval::QgsInterval |
( |
| ) |
|
◆ QgsInterval() [2/2]
QgsInterval::QgsInterval |
( |
double |
seconds | ) |
|
◆ days()
double QgsInterval::days |
( |
| ) |
const |
|
inline |
◆ fromString()
Converts a string to an interval.
- Parameters
-
- Returns
- interval, or invalid interval if string could not be parsed
Definition at line 52 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 76 of file qgsinterval.h.
◆ operator QVariant()
QgsInterval::operator QVariant |
( |
| ) |
const |
|
inline |
Allows direct construction of QVariants from intervals.
Definition at line 159 of file qgsinterval.h.
◆ operator==()
bool QgsInterval::operator== |
( |
const 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 126 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 82 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 137 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 148 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 71 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 65 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 43 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: