New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8.1: strftime depreceted #280
Comments
The solution is to use the format without % characters, i.e.: |
Format without % using date() function which doesn´t respect locale. Correct solution is implement function IntlDateFormatter::format(). (intl extension required). Docker: https://unicode-org.github.io/icu/userguide/format_parse/datetime/#date-field-symbol-table $date = new \DateTime();
$fmt = new \IntlDateFormatter(
'cs_CZ',
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
'Europe/Prague',
\IntlDateFormatter::GREGORIAN,
'EEEE DD. MMMM HH:mm'
);
echo $fmt->format($date);
edit: Correct parameters in IntlDateFormatter edit2: // DateTime need have correct timezone
date_default_timezone_set('Europe/Prague');
$date = new \DateTime();
echo \IntlDateFormatter::formatObject($date, 'EEEE DD. MMMM HH:mm', 'cs_CZ'); |
PHP 8.1 deprecated strftime so the upcoming bump would complain. nette/latte#280
Version: 2.10.6
Bug Description
strftime
is deprecated in PHP 8.1 and filterdate
could produce error.latte/src/Latte/Runtime/Filters.php
Line 439 in c0cfd1b
Steps To Reproduce
Expected Behavior
not throwing anything
Possible Solution
add
@
or replace it all together? :)The text was updated successfully, but these errors were encountered: