Parse about any English textual datetime description into a Unix timestamp using PHP’s strtotime()
This function behaves the same as PHP’s version except that it optionally accepts an $options
array and lets you specify the return value for empty or zeroed dates like 0000-00-00. If given a zerod date
then it returns null by default (rather than throwing an error as PHP8 does).
Available since version 3.0.178.
Usage
// basic usage
$false = $datetime->strtotime(string $str);
// usage with all arguments
$false = $datetime->strtotime(string $str, $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
str | string | Date/time string |
options (optional) | array, int | Options to modify behavior, or specify int for the
|
Return value
false
int
null
$datetime methods and properties
API reference based on ProcessWire core version 3.0.236