Skip to content

Command execution time uses localized AM/PM (e.g., 午前/午後) instead of "am/pm" #2871

@tkm5

Description

@tkm5

Describe the bug

The command_execution_time segment has started displaying the time using a localized format for AM/PM. In my Japanese locale (ja_JP.UTF-8), it now shows 午前 (gozen) and 午後 (gogo) instead of the previously used "am" and "pm".

While I appreciate the localization effort, I prefer the consistent and more compact "am/pm" format. This seems to be a recent change, as it worked as expected before.

To Reproduce

  1. Set the system time locale to Japanese: export LC_TIME=ja_JP.UTF-8
  2. Run a command that takes some time, e.g., sleep 1.
  3. Observe the command_execution_time segment.

Expected behavior

The time should be displayed with "am" or "pm", for example: at 10:30:15 am.

Actual behavior

The time is displayed using the localized equivalent, for example: at 午前10:30:15.

Screenshots

Image

Environment

  • OS: macOS 15.5
  • Terminal: iTerm2
  • Zsh version: zsh 5.9 (arm64-apple-darwin24.0)
  • Powerlevel10k version: 8fa10f4
  • locale output:
      LANG="ja_JP.UTF-8"
      LC_COLLATE="ja_JP.UTF-8"
      LC_CTYPE="ja_JP.UTF-8"
      LC_MESSAGES="ja_JP.UTF-8"
      LC_MONETARY="ja_JP.UTF-8"
      LC_NUMERIC="ja_JP.UTF-8"
      LC_TIME="ja_JP.UTF-8"
      LC_ALL=
    

Additional context

My POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT is set to the default 'd.h:m:s'.

Is there a way to force the "am/pm" format regardless of the system locale? Perhaps a new option or a specific format string I can use?

Thank you for your amazing work on Powerlevel10k!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions