Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
694ef721
Commit
694ef721
authored
Jun 30, 2022
by
Andrew Nicols
Browse files
MDL-74379 core: Update date_format_string to use x-os functions
parent
09858c06
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/moodlelib.php
View file @
694ef721
...
...
@@ -2357,18 +2357,15 @@ function date_format_string($date, $format, $tz = 99) {
date_default_timezone_set
(
core_date
::
get_user_timezone
(
$tz
));
$datearray
=
getdate
(
$date
);
if
(
nl_langinfo
(
AM_STR
)
==
nl_langinfo
(
PM_STR
))
{
if
(
strftime
(
'%p'
,
0
)
===
strftime
(
'%p'
,
HOURSECS
*
18
))
{
$datearray
=
getdate
(
$date
);
$format
=
str_replace
([
'%P'
,
'%p'
,
],
[
$datearray
[
'hours'
]
<
12
?
get_string
(
'am'
,
'langconfig'
)
:
get_string
(
'pm'
,
'langconfig'
),
$datearray
[
'hours'
]
<
12
?
get_string
(
'amcaps'
,
'langconfig'
)
:
get_string
(
'pmcaps'
,
'langconfig'
),
],
$format
);
],
$format
);
}
$datestring
=
strftime
(
$format
,
$date
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment