diff --git a/lang/en/langconfig.php b/lang/en/langconfig.php index 7905f6696dc..4da2ea827a6 100644 --- a/lang/en/langconfig.php +++ b/lang/en/langconfig.php @@ -39,16 +39,16 @@ $string['parentlanguage'] = ''; $string['strftimedate'] = '%d %B %Y'; $string['strftimedatefullshort'] = '%d/%m/%y'; $string['strftimedateshort'] = '%d %B'; -$string['strftimedatetime'] = '%d %B %Y, %I:%M %p'; +$string['strftimedatetime'] = '%d %B %Y, %l:%M %p'; $string['strftimedatetimeshort'] = '%d/%m/%y, %H:%M'; $string['strftimedaydate'] = '%A, %d %B %Y'; -$string['strftimedaydatetime'] = '%A, %d %B %Y, %I:%M %p'; +$string['strftimedaydatetime'] = '%A, %d %B %Y, %l:%M %p'; $string['strftimedayshort'] = '%A, %d %B'; $string['strftimedaytime'] = '%a, %H:%M'; $string['strftimemonthyear'] = '%B %Y'; $string['strftimerecent'] = '%d %b, %H:%M'; -$string['strftimerecentfull'] = '%a, %d %b %Y, %I:%M %p'; -$string['strftimetime'] = '%I:%M %p'; +$string['strftimerecentfull'] = '%a, %d %b %Y, %l:%M %p'; +$string['strftimetime'] = '%l:%M %p'; $string['thisdirection'] = 'ltr'; $string['thisdirectionvertical'] = 'btt'; $string['thislanguage'] = 'English'; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 286afc145d8..29142057ae1 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1987,8 +1987,10 @@ function userdate($date, $format = '', $timezone = 99, $fixday = true) { $textlib = textlib_get_instance(); $datestring = $textlib->convert($datestring, $localewincharset, 'utf-8'); } - } + } + // When using the %l (12-hour time with no leading zero), it adds unwanted spaces + $datestring = trim(str_replace(' ', ' ', $datestring)); return $datestring; }