Determine which locale date uses when LC_ALL, LC_TIME, and LANG are all set.
LANG=ja_JP.UTF-8
LC_TIME=de_DE.UTF-8
LC_ALL=CWhich value applies?
The usual precedence is LC_ALL, then the category-specific LC_* variable, then LANG.
Detailed explanation
ja_JP.UTF-8Incorrect. LANG is the fallback when higher-priority variables are absent.
Incorrect. LANG is the fallback when higher-priority variables are absent.
CCorrect. LC_ALL overrides LC_TIME and LANG.
Correct. LC_ALL overrides LC_TIME and LANG.
de_DE.UTF-8Incorrect. LC_TIME normally beats LANG but is overridden by LC_ALL.
Incorrect. LC_TIME normally beats LANG but is overridden by LC_ALL.
Incorrect. The variables are not concatenated; one wins by precedence.
Incorrect. The variables are not concatenated; one wins by precedence.
Try it yourself
An example you can run in a temporary verification environment.
LC_ALL=C LC_TIME=de_DE.UTF-8 LANG=ja_JP.UTF-8 locale LC_TIMEExpected result
CKey points
- LC_ALL has priority
- Then category LC_*
- LANG is fallback
Notes
- Environment: glibc locale / C 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
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.