Skip to content

bug(date) incorrectly converts %Y to the Thai Buddhist calendar when LC_TIME=th_TH.UTF-8 is set. #12891

@compilersutra

Description

@compilersutra

Reproducer

$ locale -k LC_TIME
abday="Sun;Mon;Tue;Wed;Thu;Fri;Sat"
day="Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday"
abmon="Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec"
mon="January;February;March;April;May;June;July;August;September;October;November;December"
era=
alt_digits=
env -u LC_ALL LC_TIME=th_TH.UTF-8 \
./target/release/date -d "2026-06-14" "+%Y %B %A"

Actual output

2569 มิถุนายน วันอาทิตย์

Expected output

2026 June Sunday

GNU comparison

env -u LC_ALL LC_TIME=th_TH.UTF-8 \
date -d "2026-06-14" "+%Y %B %A"

GNU date prints:

2026 June Sunday

Notes

The active LC_TIME data contains:

mon="January;February;March;April;May;June;July;August;September;October;November;December"
day="Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday"
era=
alt_digits=

However, uutils prints a Buddhist Era year (2569) and Thai month/weekday names.

This suggests that the formatter is not honoring the active locale data and is instead deriving formatting behavior directly from the locale identifier (th_TH.UTF-8).

Expected behavior is to match GNU date and use the values provided by the active LC_TIME definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions