strptime
Function • Misc changes in PHP 8.4
Parse a time/date generated with strftime.
strptime Function synopsis
#[\Deprecated]
strptime(string $timestamp, string $format): array|false
Parameters
$timestamp
Typestring
The string to parse (e.g. returned from strftime).
$format
Typestring
The format used in $timestamp (e.g. the same as
used in strftime). Note that some of the format
options available to strftime may not have any
effect within strptime; the exact subset that are
supported will vary based on the operating system and C library in
use.
Return value
Typearray|false
Returns an array or false on failure.
Changes to the strptime Function
PHP 8.4
- Attribute added:
#[Deprecated]
PHP 8.1
- Function deprecated
PHP 8.0
- Return type added:
array|false - Parameter type added for parameter #1 (
$timestamp):string - Parameter type added for parameter #2 (
$format):string
- strptime($timestamp, $format)
+ strptime(string $timestamp, string $format): array|false strptime Function Availability
strptime Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes Deprecated |
| PHP 8.5Supported (Latest) | Yes Deprecated |
| PHP 8.4Supported | Yes Deprecated |
| PHP 8.3Security-Fixes Only | Yes Deprecated |
| PHP 8.2Security-Fixes Only | Yes Deprecated |
| PHP 8.1Unsupported | Yes Deprecated |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |