Welcome to the Power Users community on Codidact!
Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.
Comments on How to set the default time format in Linux Debian.
Parent
How to set the default time format in Linux Debian.
How to set the default time format in Linux? For example to set the format the date
command outputs when run with no parameters.
Post
You can define the LC_TIME
environment variable. In ~/.profile
if you start you session in a login shell or else ~/.bashrc
, put
export LC_TIME=ru_RU.UTF-8
For example,
% LC_TIME=ru_RU.UTF-8 date
Сб 07 окт 2023 13:39:21 CEST
will make the output format be in Russian,
That only works if you already have that locale enabled (or, better said, generated), which you can check with locale -a
. If it is not generated yet, find the corresponding line in /etc/locale.gen
, remove the #
from it and run locale-gen
.
In a desktop environment, there might be a corresponding option in the localization settings.
All the environment variables heeded by date
specifically are found in the POSIX specification.
And the locale section lists the variable in more details, as well as which other functions must respect it.
There is an expectation, but not a guarantee, that time related programs and functions will respect that variable.
0 comment threads