MDL-75100 core: replace function strftime deprecated in PHP 8.1

This commit is contained in:
Marina Glancy
2022-11-21 11:41:12 +01:00
parent 7c14a2239a
commit 7bbb5434bf
10 changed files with 219 additions and 19 deletions
+2 -2
View File
@@ -2377,7 +2377,7 @@ function date_format_string($date, $format, $tz = 99) {
date_default_timezone_set(core_date::get_user_timezone($tz));
if (strftime('%p', 0) === strftime('%p', HOURSECS * 18)) {
if (date('A', 0) === date('A', HOURSECS * 18)) {
$datearray = getdate($date);
$format = str_replace([
'%P',
@@ -2388,7 +2388,7 @@ function date_format_string($date, $format, $tz = 99) {
], $format);
}
$datestring = strftime($format, $date);
$datestring = core_date::strftime($format, $date);
core_date::set_default_server_timezone();
if ($localewincharset) {