Incorrect/misleading Time Format For ms_MY (AM/PM)

Bug #1986803 reported by Amin Husni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GLibC
Fix Released
Medium
glibc (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Date format problem when representing time in ms_MY. 12-hour clock is used despite AM/PM localization string is empty.

Expectation:
When running the command `date`, output was `Rabu 17 Ogos 2022 20:35:36 +08`

What happened instead:
When running the command `date`, output was `Rabu 17 Ogos 2022 08:35:36 +08`

These were run during the PM side of time. When running it in the morning, it shows as expected.

Additional Information:
Description: Ubuntu 22.04.1 LTS
Release: 22.04

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: locales 2.35-0ubuntu3.1
ProcVersionSignature: Ubuntu 5.15.0-46.49-generic 5.15.39
Uname: Linux 5.15.0-46-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Wed Aug 17 20:30:44 2022
InstallationDate: Installed on 2022-08-12 (4 days ago)
InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809.1)
PackageArchitecture: all
SourcePackage: glibc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Amin Husni (aminhusni-5) wrote :
Revision history for this message
Simon Chopin (schopin) wrote : Re: [Bug 1986803] [NEW] Incorrect/misleading Time Format For ms_MY (AM/PM)

Hi!

Thank you for the report.

I tried to find more information about time representation in Malaysia,
but the only thing I could find was this:

https://en.wikipedia.org/wiki/Date_and_time_representation_by_country#/media/File:12_24_Hours_World_Map.svg

Assuming this map is correct, the expected representation should be
using 12-hour format, as is the case currently. However I'm assuming
there should be a marker to differentiate betwen AM and PM, which I
cannot see.

Can you confirm that, or maybe point us to a more reliable source on
which to base the format?

Changed in glibc (Ubuntu):
status: New → Incomplete
Revision history for this message
Amin Husni (aminhusni-5) wrote :

Hi,

The current locale format does specify to print AM/PM markers but the localized strings for AM/PM are empty.

I am confident that we do not actually have an established time format in a standardization sense. At least when I try to find it in The Official Website of Department of Standards Malaysia.
However, for the official Malaysian time format according to Kamus Dewan Bahasa (Institute of Language and Literature), AM and PM are not used in the language.

Ref (translated):
https://prpm.dbp.gov.my/Cari1?keyword=pm&d=175768&

In Malay Language, the words am and pm are not used, instead for the time period 1.00 am - 11.59 am is called morning, 12.00 pm - 1.59 pm is called noon, 2.00 pm - 6.59 is called evening, 7.00 pm - 11.59 pm is called night and 12.00 am - 12.59 generally called midnight.

Original source text:
Dalam bahasa Melayu perkataan am dan pm tidak diunakan, sebaliknya untuk tempoh masa 1.00 am - 11.59 am dinamakan pagi, 12.00 pm - 1.59 pm dinamakan tengah hari, 2.00 pm - 6.59 dinamakan petang, 7.00 pm - 11.59 pm dinamakan malam dan 12.00 am - 12.59 am dinamakan tengah malam.

With that said, I think this is definitely not going to work with the localization files.

One way I would suggest to solve this is to compromise on a 24-hour format since that is the international standard notation of time (ISO 8601).

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

The intention in the ms_MY locale seems to be to support the distinction between am and pm. That's what the '%p' part is about:

$ LC_TIME=ms_MY.UTF-8 locale date_fmt
%A %d %b %Y %I:%M:%S %p %Z

However, the am_pm definition is empty:

$ LC_TIME=ms_MY.UTF-8 locale am_pm
;

and that's probably a mistake.

With that said, Ubuntu uses the locales provided by glibc, so this request should rather be made upstream:

https://sourceware.org/bugzilla/enter_bug.cgi?product=glibc&component=localedata

If you submit an upstream bug report, please post the URL to it here for tracking purposes.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@Amin: I hadn't seen your latest comment when I submitted my comment. But as regards the conclusion, i.e. submitting an upstream bug report, my advice still stands.

Revision history for this message
In , Amin Husni (aminhusni-5) wrote :

Problem Summary
====================

Date format problem when representing time in ms_MY. 12-hour clock is used despite AM/PM localization string is empty.

Expectation:
When running the command `date`, output was `Rabu 17 Ogos 2022 20:35:36 +08`

What happened instead:
When running the command `date`, output was `Rabu 17 Ogos 2022 08:35:36 +08`

These were run during the PM side of time. When running it in the morning, it shows as expected.

Problem Detail
====================

The current locale format does specify to print AM/PM markers but the localized strings for AM/PM are empty.

I am confident that we do not actually have an established time format in a standardization sense. At least when I try to find it on The Official Website of Department of Standards Malaysia.
However, for the official Malaysian time format according to Kamus Dewan Bahasa (Institute of Language and Literature), AM and PM are not used in the language.

Ref (translated):
https://prpm.dbp.gov.my/Cari1?keyword=pm&d=175768&

In Malay Language, the words am and pm are not used, instead for the time period 1.00 am - 11.59 am is called morning, 12.00 pm - 1.59 pm is called noon, 2.00 pm - 6.59 is called evening, 7.00 pm - 11.59 pm is called night and 12.00 am - 12.59 generally called midnight.

Original source text:
Dalam bahasa Melayu perkataan am dan pm tidak diunakan, sebaliknya untuk tempoh masa 1.00 am - 11.59 am dinamakan pagi, 12.00 pm - 1.59 pm dinamakan tengah hari, 2.00 pm - 6.59 dinamakan petang, 7.00 pm - 11.59 pm dinamakan malam dan 12.00 am - 12.59 am dinamakan tengah malam.

With that said, I think this is definitely not going to work with the localization files.

One way I would suggest solving this is to compromise on a 24-hour format since that is the international standard notation of time (ISO 8601).

Additional Bug Reference
====================

https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1986803

Revision history for this message
Amin Husni (aminhusni-5) wrote :

@Gunnar thank you for your recommendation.

I've submitted an upstream bug report here:
https://sourceware.org/bugzilla/show_bug.cgi?id=29504

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks. I changed the "component" from locale to localedata.

Changed in glibc (Ubuntu):
status: Incomplete → New
Changed in glibc:
importance: Unknown → Medium
status: Unknown → New
Changed in glibc (Ubuntu):
importance: Undecided → Medium
Simon Chopin (schopin)
Changed in glibc (Ubuntu):
status: New → Triaged
Revision history for this message
In , Mike FABIAN (mike-fabian) wrote :

Current output:

$ LC_ALL=ms_MY.UTF-8 date --date="2024-01-03 14:03:17" +%c
Rabu 03 Jan 2024 02:03:17
$ LC_ALL=ms_MY.UTF-8 date --date="2024-01-03 14:03:17"
Rabu 03 Jan 2024 02:03:17 CET
$ LC_ALL=ms_MY.UTF-8 date --date="2024-01-03 14:03:17" +%x
Rabu 03 Jan 2024
$ LC_ALL=ms_MY.UTF-8 date --date="2024-01-03 14:03:17" +%X
02:03:17 CET

Revision history for this message
In , Mike FABIAN (mike-fabian) wrote :

Created attachment 15280
0001-localedata-ms_MY-should-not-use-12-hour-format.patch

With that patch applied, the output becomes:

bash-5.2# LC_ALL=ms_MY.UTF-8 date --date="2024-01-03 14:03:17" +%c
Rabu 03 Jan 2024 14:03:17
bash-5.2# LC_ALL=ms_MY.UTF-8 date --date="2024-01-03 14:03:17"
Rabu 03 Jan 2024 14:03:17 CET
bash-5.2# LC_ALL=ms_MY.UTF-8 date --date="2024-01-03 14:03:17" +%x
Rabu 03 Jan 2024
bash-5.2# LC_ALL=ms_MY.UTF-8 date --date="2024-01-03 14:03:17" +%X
14:03:17 CET
bash-5.2#

Revision history for this message
In , Cvs-commit (cvs-commit) wrote :

The master branch has been updated by Mike Fabian <email address hidden>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fe316dad7ccfe44e9d649727b04cd36708477545

commit fe316dad7ccfe44e9d649727b04cd36708477545
Author: Mike FABIAN <email address hidden>
Date: Wed Jan 3 11:07:27 2024 +0100

    localedata: ms_MY should not use 12-hour format

    Resolves: BZ # 29504

Revision history for this message
In , Mike FABIAN (mike-fabian) wrote :

Fixed in glibc master.

Changed in glibc:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.