Class SS_Datetime
Represents a date-time field. The field currently supports New Zealand date format (DD/MM/YYYY), or an ISO 8601 formatted date and time (Y-m-d H:i:s). Alternatively you can set a timestamp that is evaluated through PHP's built-in date() and strtotime() function according to your system locale.
For all computations involving the current date and time, please use SS_Datetime::now() instead of PHP's built-in date() and time() methods. This
ensures that all time-based computations are testable with mock dates through
SS_Datetime::set_mock_now().
- Object
-
ViewableData
implements
IteratorAggregate
-
DBField
-
Date
-
SS_Datetime
Methods summary
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
scaffoldFormField( string $title = null, mixed $params = null )
Returns a FormField instance used as a default for form scaffolding. |
public
|
#
scaffoldSearchField( string $title = null )
Returns a FormField instance used as a default for searchform scaffolding. |
public static
|
#
now( )
Returns either the current system date as determined by date(), or a mocked
date through |
public static
|
#
set_mock_now(
Mock the system date temporarily, which is useful for time-based unit
testing. Use |
public static
|
Methods inherited from Date
Ago(),
Day(),
DayOfMonth(),
Format(),
FormatI18N(),
Full(),
InFuture(),
InPast(),
IsToday(),
Long(),
Month(),
NiceUS(),
RangeString(),
Rfc2822(),
Rfc3339(),
Rfc822(),
ShortMonth(),
TimeDiff(),
TimeDiffIn(),
URLDate(),
Year(),
day_before(),
days_between(),
next_day(),
past_date(),
prior_monday(),
weekday()
Methods inherited from DBField
ATT(),
HTML(),
HTMLATT(),
JS(),
LowerCase(),
RAW(),
RAWURLATT(),
URLATT(),
UpperCase(),
XML(),
__construct(),
addToQuery(),
create(),
debug(),
defaultSearchFilter(),
exists(),
forTemplate(),
getName(),
getValue(),
hasValue(),
nullValue(),
prepValueForDB(),
saveInto(),
setName(),
setTable(),
writeToManipulation()
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
defineMethods(),
escapeTypeForField(),
getField(),
getIterator(),
getSecurityID(),
getXMLValues(),
hasField(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj(),
setField()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
createMethod(),
create_from_string(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Properties summary
protected static
mixed
|
$mock_now |
Properties inherited from DBField
$arrayValue,
$defaultVal,
$default_search_filter_class,
$escape_type,
$name,
$tableName,
$value
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems