Determine the effective date/time locale from the provided environment values.
LANG=en_US.UTF-8
LC_TIME=ja_JP.UTF-8
LC_ALL=CWhich value becomes effective?
Locale precedence is LC_ALL, then the corresponding LC_* variable, then LANG. Therefore the effective value is C.
Detailed explanation
en_US.UTF-8Incorrect. LANG is the lowest-priority fallback.
ja_JP.UTF-8Incorrect. LC_TIME is overridden by LC_ALL.
CCorrect. LC_ALL=C has the highest priority.
Incorrect. The precedence resolves the value to C.
Try it yourself
An example you can run in a temporary verification environment.
LANG=en_US.UTF-8 LC_TIME=ja_JP.UTF-8 LC_ALL=C locale LC_TIMEExpected result
CKey points
- LC_ALL > LC_* > LANG
- Evaluate each category
- LC_ALL overrides all
Notes
- Environment: POSIX locale / 子プロセス環境だけ変更
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Locale category
A setting that controls language, numeric formatting, collation, or date display.
Character encoding
A mapping between characters and the bytes used to represent them.
Timezone
A rule set that converts timestamps for a region or display context.