Subgroup: other
Class: QgsInterval¶
-
class
qgis.core.
QgsInterval
¶ Bases:
sip.wrapper
A representation of the interval between two datetime values.
New in version 2.16: Methods
days
Returns the interval duration in days. fromString
Converts a string to an interval hours
Returns the interval duration in hours. isValid
Returns true if the interval is valid. minutes
Returns the interval duration in minutes. months
Returns the interval duration in months (based on a 30 day month). seconds
Returns the interval duration in seconds. setDays
Sets the interval duration in days. setHours
Sets the interval duration in hours. setMinutes
Sets the interval duration in minutes. setMonths
Sets the interval duration in months. setSeconds
Sets the interval duration in seconds. setValid
Sets whether the interval is valid. setWeeks
Sets the interval duration in weeks. setYears
Sets the interval duration in years. weeks
Returns the interval duration in weeks. years
Returns the interval duration in years (based on an average year length) Attributes
DAY
HOUR
MINUTE
MONTHS
WEEKS
YEARS
-
DAY
= 86400¶
-
HOUR
= 3600¶
-
MINUTE
= 60¶
-
MONTHS
= 2592000¶
-
WEEKS
= 604800¶
-
YEARS
= 31557600¶
-
fromString
(string: str) → QgsInterval¶ Converts a string to an interval
Parameters: string – string to parse Returns: interval, or invalid interval if string could not be parsed
-
hours
(self) → float¶ Returns the interval duration in hours.
See also
-
isValid
(self) → bool¶ Returns true if the interval is valid.
See also
-
minutes
(self) → float¶ Returns the interval duration in minutes.
See also
-
months
(self) → float¶ Returns the interval duration in months (based on a 30 day month).
See also
-
seconds
(self) → float¶ Returns the interval duration in seconds.
See also
-
setDays
(self, days: float)¶ Sets the interval duration in days.
Parameters: days – duration in days See also
-
setHours
(self, hours: float)¶ Sets the interval duration in hours.
Parameters: hours – duration in hours See also
-
setMinutes
(self, minutes: float)¶ Sets the interval duration in minutes.
Parameters: minutes – duration in minutes See also
-
setMonths
(self, months: float)¶ Sets the interval duration in months.
Parameters: months – duration in months (based on a 30 day month) See also
-
setSeconds
(self, seconds: float)¶ Sets the interval duration in seconds.
Parameters: seconds – duration in seconds See also
-
setValid
(self, valid: bool)¶ Sets whether the interval is valid.
Parameters: valid – set to true to set the interval as valid. See also
-
setWeeks
(self, weeks: float)¶ Sets the interval duration in weeks.
Parameters: weeks – duration in weeks See also
-
setYears
(self, years: float)¶ Sets the interval duration in years.
Parameters: years – duration in years (based on average year length) See also
-
weeks
(self) → float¶ Returns the interval duration in weeks.
See also
-
years
(self) → float¶ Returns the interval duration in years (based on an average year length)
See also
-