CWIS Developer Documentation
|
Public Member Functions | |
__construct ($BeginDate, $EndDate=NULL, $Precision=NULL, $DebugLevel=0) | |
Object constructor. More... | |
Formatted () | |
Get date value suitable for display. More... | |
PFormatted ($Format, $ReturnEndDate=FALSE) | |
Get date in format specified like PHP date() format parameter. More... | |
FormattedForSql ($ReturnEndDate=FALSE) | |
Get begin date (or end date if requested) formatted for SQL DATETIME field. More... | |
FormattedISO8601 () | |
Get begin time in ISO 8601 format. More... | |
BeginDate () | |
Get normalized begin date, suitable for storing via SQL. More... | |
EndDate () | |
Get normalized end date, suitable for storing via SQL. More... | |
Precision ($NewPrecision=NULL) | |
Get/set date precision (combination of self::PRE_ bit constants). More... | |
SqlCondition ($FieldName, $EndFieldName=NULL, $Operator="=") | |
Get SQL condition for records that match date. More... | |
FormattedPrecision ($Precision=NULL) | |
Get string containing printable version of precision flags. More... | |
Public Attributes | |
const | PRE_BEGINYEAR = 1 |
const | PRE_BEGINMONTH = 2 |
const | PRE_BEGINDAY = 4 |
const | PRE_BEGINDECADE = 8 |
const | PRE_BEGINCENTURY = 16 |
const | PRE_ENDYEAR = 32 |
const | PRE_ENDMONTH = 64 |
const | PRE_ENDDAY = 128 |
const | PRE_ENDDECADE = 256 |
const | PRE_ENDCENTURY = 512 |
const | PRE_INFERRED = 1024 |
const | PRE_COPYRIGHT = 2048 |
const | PRE_CONTINUOUS = 4096 |
Date::__construct | ( | $BeginDate, | |
$EndDate = NULL , |
|||
$Precision = NULL , |
|||
$DebugLevel = 0 |
|||
) |
Object constructor.
string | $BeginDate | Date (or beginning date, if range). |
string | $EndDate | Ending date (OPTIONAL, default to NULL). |
int | $Precision | Known precision of date (ORed combination of self::PRE_ constants). (OPTIONAL, defaults to NULL) |
int | $DebugLevel | Debugging output level. |
Definition at line 44 of file Date.php.
References FormattedPrecision(), and Precision().
Date::BeginDate | ( | ) |
Get normalized begin date, suitable for storing via SQL.
Definition at line 523 of file Date.php.
References Precision().
Date::EndDate | ( | ) |
Get normalized end date, suitable for storing via SQL.
Definition at line 560 of file Date.php.
References Precision().
Date::Formatted | ( | ) |
Get date value suitable for display.
Definition at line 375 of file Date.php.
References Precision().
Date::FormattedForSql | ( | $ReturnEndDate = FALSE | ) |
Get begin date (or end date if requested) formatted for SQL DATETIME field.
bool | $ReturnEndDate | If TRUE, return end date instead of begin. (OPTIONAL, defaults to FALSE) |
Definition at line 480 of file Date.php.
References PFormatted().
Date::FormattedISO8601 | ( | ) |
Get begin time in ISO 8601 format.
Definition at line 489 of file Date.php.
References Precision().
Date::FormattedPrecision | ( | $Precision = NULL | ) |
Get string containing printable version of precision flags.
int | $Precision | Precision to use. (OPTIONAL, defaults to current precision value for date) |
Definition at line 748 of file Date.php.
Referenced by __construct().
Date::PFormatted | ( | $Format, | |
$ReturnEndDate = FALSE |
|||
) |
Get date in format specified like PHP date() format parameter.
string | $Format | Format string. |
bool | $ReturnEndDate | If TRUE, return end date instead of begin. (OPTIONAL, defaults to FALSE) |
Definition at line 457 of file Date.php.
References Precision().
Referenced by FormattedForSql().
Date::Precision | ( | $NewPrecision = NULL | ) |
Get/set date precision (combination of self::PRE_ bit constants).
int | $NewPrecision | New precision value. (OPTIONAL) |
Definition at line 598 of file Date.php.
Referenced by __construct(), BeginDate(), EndDate(), Formatted(), FormattedISO8601(), PFormatted(), and SqlCondition().
Date::SqlCondition | ( | $FieldName, | |
$EndFieldName = NULL , |
|||
$Operator = "=" |
|||
) |
Get SQL condition for records that match date.
string | $FieldName | Database column name that contains date (or begin date, if range). |
string | $EndFieldName | Database column name that contains end date (for ranges). (OPTIONAL, defaults to NULL) |
string | $Operator | Comparison operator. (OPTIONAL, defaults to "=") |
Definition at line 613 of file Date.php.
References Precision().
const Date::PRE_BEGINDAY = 4 |
Definition at line 24 of file Date.php.
Referenced by MetadataField\Drop(), and Date_Test\testInputFormats().
const Date::PRE_BEGINMONTH = 2 |
Definition at line 23 of file Date.php.
Referenced by MetadataField\Drop(), and Date_Test\testInputFormats().
const Date::PRE_BEGINYEAR = 1 |
Definition at line 22 of file Date.php.
Referenced by Date_Test\testInputFormats().
const Date::PRE_COPYRIGHT = 2048 |
Definition at line 33 of file Date.php.
Referenced by Date_Test\testInputFormats().