Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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.

How to set the default time format in Linux Debian.

+2
−0

How to set the default time format in Linux? For example to set the format the date command outputs when run with no parameters.

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+2
−0

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.

History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

Don't understand that. I was asking about the time format. How is that bind to a locale? Shouldn't th... (4 comments)

Sign up to answer this question »