Skip to content

Conversation

@sylvestre
Copy link
Contributor

No description provided.

@ChrisDryden
Copy link
Collaborator

How would you feel if using the icu_datetime crate we were able to get the 12 or 24 hour status from that instead? I am proposing to add it as part of #9722 and it has the unsafe methods for getting that information

fn detect_12_hour_format() -> bool {
// Helper function to check for 12-hour format indicators
fn has_12_hour_indicators(format_str: &str) -> bool {
const INDICATORS: &[&str] = &["%I", "%l", "%r"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    let d_t_fmt = get_locale_info(nix::libc::D_T_FMT);
    let t_fmt_opt = get_locale_info(nix::libc::T_FMT);
    let t_fmt_ampm_opt = get_locale_info(nix::libc::T_FMT_AMPM);

Should we use the same notation here instead of the direct strings? Whats the reason for using the D_T_FMT notation below? Is there a possible difference on different platforms?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i used the previous notation :)

@sylvestre
Copy link
Contributor Author

unbreak the ci

@sylvestre sylvestre merged commit 645b105 into uutils:main Dec 19, 2025
126 of 127 checks passed
@sylvestre sylvestre deleted the locale-date branch December 19, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants