gmstrftime
Function • Misc changes in PHP 8.4
Format a GMT/UTC time/date according to locale settings.
gmstrftime Function synopsis
#[\Deprecated]
gmstrftime(string $format, ?int $timestamp = null): string|false
Parameters
$format
Typestring
See description in strftime.
$timestamp
OptionalType?intDefault valuenull
Return value
Typestring|false
Returns a string formatted according to the given format string
using the given $timestamp or the current
local time if no timestamp is given. Month and weekday names and
other language dependent strings respect the current locale set
with setlocale.
On failure, false is returned.
Changes to the gmstrftime Function
PHP 8.4
- Attribute added:
#[Deprecated]
PHP 8.1
- Function deprecated
PHP 8.0
- Return type added:
string|false - Parameter type added for parameter #1 (
$format):string - Parameter type added for parameter #2 (
$timestamp):?int - Parameter default value added for position #2 (
$timestamp):null
- gmstrftime($format, $timestamp)
+ gmstrftime(string $format, ?int $timestamp = null): string|false gmstrftime Function Availability
gmstrftime 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 |