Parse English textual datetime description into a formatted date string, or blank if not a date
Available since version 3.0.238.
Usage
// basic usage
$string = $datetime->strtodate(string $str);
// usage with all arguments
$string = $datetime->strtodate(string $str, $format = true, array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
str | string | Date/time string to parse |
format (optional) | string, array | Output format to use, or array for $options.
|
options (optional) | array | Can also be specified as 2nd argument. Options include:
|
Return value
string
Return string, returns blank string on fail.
$datetime methods and properties
API reference based on ProcessWire core version 3.0.244