Skip to content

Commit

Permalink
Use Locale::getDefault() before setlocale(LC_TIME, '0')
Browse files Browse the repository at this point in the history
  • Loading branch information
alphp committed Mar 12, 2024
1 parent 2ee69eb commit 10c13fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/php-8.1-strftime.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function strftime (string $format, $timestamp = null, ?string $locale = null) :

$timestamp->setTimezone(new DateTimeZone(date_default_timezone_get()));

$locale = Locale::canonicalize($locale ?? setlocale(LC_TIME, '0'));
$locale = Locale::canonicalize($locale ?? (Locale::getDefault() ?? setlocale(LC_TIME, '0')));

$intl_formats = [
'%a' => 'ccc', // An abbreviated textual representation of the day Sun through Sat
Expand Down

0 comments on commit 10c13fa

Please sign in to comment.