We use both Arabic and English in our site.
Can someone describe the process where I can change the clock across the whole site to display a 24-hour format?
Thank you.
have a look at the localized strings in lang/en/langconfig.php
$string['strftimedate'] = '%d %B %Y';
$string['strftimedatefullshort'] = '%d/%m/%y';
$string['strftimedateshort'] = '%d %B';
$string['strftimedatetime'] = '%d %B %Y, %I:%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['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';
Changing these values using Site administration ► Language ► Language customisation can help.
Thank you Renaat,
Do you know exactly what I should change these values to? I have a bit of confusion as to what I should put in the place of these values.
The php manual learns:
- a Lowercase Ante meridiem and Post meridiem am or pm
- A Uppercase Ante meridiem and Post meridiem AM or PM
- g 12-hour format of an hour without leading zeros 1 through 12
- G 24-hour format of an hour without leading zeros 0 through 23
- h 12-hour format of an hour with leading zeros 01 through 12
- H 24-hour format of an hour with leading zeros 00 through 23
So replace all g into G and h into H in your Arab and English language strings to have a 24 hour format.
Thank you again Renaat. Unfortunately none of the settings in lang/en/langconfig.php use the lowercase g or h.
I am trying to figure out how to change the strftime settings so it displays a 24-hour clock. My settings are currently set like this:
core_langconfig strftimedate %d %B %Y
core_langconfig strftimedatefullshort %d/%m/%y
core_langconfig strftimedateshort %d %B
core_langconfig strftimedatetime %d %B %Y, %I:%M %p
core_langconfig strftimedatetimeshort %d/%m/%y، %H:%M
%d/%m/%y,
%H:%M
core_langconfig strftimedaydatetime %A, %d %B %Y, %I:%M %p
core_langconfig strftimedayshort %A, %d %B
core_langconfig strftimedaytime %a, %H:%M
core_langconfig strftimemonthyear %B %Y
core_langconfig strftimerecent %d %b, %H:%M
core_langconfig strftimerecentfull %a, %d %b %Y, %I:%M %p
core_langconfig strftimetime %I:%M %p
How to change what is where I'm confused.Use Site administration ► Language ► Language customisation ► Open Arabic language pack
select in Show strings of these component: langconfig.php
Click on Show strings
There should be a g or h that you can change into G or H.
If not, you are working with a plugin that is not respecting the Moodle language configuration...