classQDateTimeSpan
QDateTimeSpan Class Reference
Inherits QBaseClass.

Public Member Functions
- __construct ($intSeconds=0)
- IsPositive ()
- IsNegative ()
- IsZero ()
- Difference (QDateTimeSpan $dtsSpan)
- SetFromQDateTime (QDateTime $dttFrom, QDateTime $dttTo)
- AddSeconds ($intSeconds)
- AddMinutes ($intMinutes)
- AddHours ($intHours)
- AddDays ($intDays)
- AddMonths ($intMonths)
- Add (QDateTimeSpan $dtsSpan)
- Subtract (QDateTimeSpan $dtsSpan)
- SimpleDisplay ()
- __get ($strName)
- __set ($strName, $mixValue)
Public Attributes
- const SecondsPerYear = 31556926
- const SecondsPerMonth = 2592000
- const SecondsPerDay = 86400
- const SecondsPerHour = 3600
- const SecondsPerMinute = 60
Protected Member Functions
- GetYears ()
- GetMonths ()
- GetDays ()
- GetHours ()
- GetMinutes ()
- GetTimearray ()
Protected Attributes
Constructor & Destructor Documentation
| QDateTimeSpan::__construct | ( | $ | intSeconds = 0 |
) |
References $intSeconds.
Member Function Documentation
| QDateTimeSpan::__get | ( | $ | strName | ) |
Override method to perform a property "Get" This will get the value of $strName
- Parameters:
-
string $strName Name of the property to get
- Returns:
- mixed the returned property
Reimplemented from QBaseClass.
References GetDays(), GetHours(), GetMinutes(), GetMonths(), GetTimearray(), GetYears(), and QCallerException::IncrementOffset().
| QDateTimeSpan::__set | ( | $ | strName, | |
| $ | mixValue | |||
| ) |
Override method to perform a property "Set" This will set the property $strName to be $mixValue
- Parameters:
-
string $strName Name of the property to set string $mixValue New value of the property
- Returns:
- mixed the property that was set
Reimplemented from QBaseClass.
References QType::Cast(), QCallerException::IncrementOffset(), and QType::Integer.
| QDateTimeSpan::Add | ( | QDateTimeSpan $ | dtsSpan | ) |
Adds a QDateTimeSpan to current QDateTimeSpan
- Parameters:
-
QDateTimeSpan $dtsSpan
Referenced by SetFromQDateTime().
| QDateTimeSpan::AddDays | ( | $ | intDays | ) |
Adds an amount of days to the current QDateTimeSpan
- Parameters:
-
int $intDays
References SecondsPerDay.
| QDateTimeSpan::AddHours | ( | $ | intHours | ) |
Adds an amount of hours to the current QDateTimeSpan
- Parameters:
-
int $intHours
References SecondsPerHour.
| QDateTimeSpan::AddMinutes | ( | $ | intMinutes | ) |
Adds an amount of minutes to the current QDateTimeSpan
- Parameters:
-
int $intMinutes
References SecondsPerMinute.
| QDateTimeSpan::AddMonths | ( | $ | intMonths | ) |
Adds an amount of months to the current QDateTimeSpan
- Parameters:
-
int $intMonths
References SecondsPerMonth.
| QDateTimeSpan::AddSeconds | ( | $ | intSeconds | ) |
Adds an amount of seconds to the current QDateTimeSpan
- Parameters:
-
int $intSeconds
References $intSeconds.
| QDateTimeSpan::Difference | ( | QDateTimeSpan $ | dtsSpan | ) |
Calculates the difference between this DateSpan and another DateSpan
- Parameters:
-
QDateTimeSpan $dtsSpan
- Returns:
- new QDateTimeSpan
| QDateTimeSpan::GetDays | ( | ) | [protected] |
Calculates the total whole days in the current QDateTimeSpan
- Returns:
- int
References IsNegative(), IsPositive(), and SecondsPerDay.
Referenced by __get().
| QDateTimeSpan::GetHours | ( | ) | [protected] |
Calculates the total whole hours in the current QDateTimeSpan
- Returns:
- int
References IsNegative(), IsPositive(), and SecondsPerHour.
Referenced by __get().
| QDateTimeSpan::GetMinutes | ( | ) | [protected] |
Calculates the total whole minutes in the current QDateTimeSpan
- Returns:
- int
References IsNegative(), IsPositive(), and SecondsPerMinute.
Referenced by __get().
| QDateTimeSpan::GetMonths | ( | ) | [protected] |
Calculates the total whole months in the current QDateTimeSpan
- Returns:
- int
References IsNegative(), IsPositive(), and SecondsPerMonth.
Referenced by __get().
| QDateTimeSpan::GetTimearray | ( | ) | [protected] |
Return an array of timeunints
- Returns:
- array of timeunits
References $intSeconds, IsNegative(), IsPositive(), SecondsPerDay, SecondsPerHour, SecondsPerMinute, SecondsPerMonth, and SecondsPerYear.
Referenced by __get(), and SimpleDisplay().
| QDateTimeSpan::GetYears | ( | ) | [protected] |
Calculates the total whole years in the current QDateTimeSpan
- Returns:
- int
References IsNegative(), IsPositive(), and SecondsPerYear.
Referenced by __get().
| QDateTimeSpan::IsNegative | ( | ) |
Checks if the current DateSpan is negative
- Returns:
- boolean
Referenced by GetDays(), GetHours(), GetMinutes(), GetMonths(), GetTimearray(), and GetYears().
| QDateTimeSpan::IsPositive | ( | ) |
Checks if the current DateSpan is positive
- Returns:
- boolean
Referenced by GetDays(), GetHours(), GetMinutes(), GetMonths(), GetTimearray(), and GetYears().
| QDateTimeSpan::IsZero | ( | ) |
Checks if the current DateSpan is zero
- Returns:
- boolean
Sets current QDateTimeSpan to the difference between two QDateTime objects
References Add(), and QDateTime::Difference().
| QDateTimeSpan::SimpleDisplay | ( | ) |
References GetTimearray().
| QDateTimeSpan::Subtract | ( | QDateTimeSpan $ | dtsSpan | ) |
Member Data Documentation
QDateTimeSpan::$intSeconds [protected] |
Referenced by __construct(), AddSeconds(), and GetTimearray().
| const QDateTimeSpan::SecondsPerDay = 86400 |
Referenced by AddDays(), GetDays(), and GetTimearray().
| const QDateTimeSpan::SecondsPerHour = 3600 |
Referenced by AddHours(), GetHours(), and GetTimearray().
| const QDateTimeSpan::SecondsPerMinute = 60 |
Referenced by AddMinutes(), GetMinutes(), and GetTimearray().
| const QDateTimeSpan::SecondsPerMonth = 2592000 |
Referenced by AddMonths(), GetMonths(), and GetTimearray().
| const QDateTimeSpan::SecondsPerYear = 31556926 |
Referenced by GetTimearray(), and GetYears().
The documentation for this class was generated from the following file:
- qcodo/_core/framework/QDateTimeSpan.class.php
