How do I change the output of `date` back to 24-hour format?who -b date format varies strangelyLinux ls wrong...
Compelling story with the world as a villain
Heyacrazy: No Diagonals
Handling Disruptive Student on the Autistic Spectrum
Who was president of the USA?
What would make bones be of different colors?
Architectural feasibility of a tiered circular stone keep
"There were either twelve sexes or none."
Was the Boeing 2707 design flawed?
Why do all fields in a QFT transform like *irreducible* representations of some group?
Why is it not possible to create electricity by forcibly putting electrons into the system and closing the loop?
Algorithms vs LP or MIP
The No-Free-Lunch Theorem and K-NN consistency
Numbers Decrease while Letters Increase
Why in most German places is the church the tallest building?
Did a flight controller ever answer Flight with a no-go?
Disambiguation of "nobis vobis" and "nobis nobis"
Very slow boot time and poor perfomance
Does Norwegian overbook flights?
"Sorry to bother you" in an email?
Can I get temporary health insurance while moving to the US?
If an earthquake can destroy buildings why it cant kill us according to physics?
Does this VCO produce a sine wave or square wave
Why doesn't the Bitcoin-qt client ask for the Wallet passphrase upon startup?
How do I get toddlers to stop asking for food every hour?
How do I change the output of `date` back to 24-hour format?
who -b date format varies strangelyLinux ls wrong date formatHow to run commands on a variable containing a date?How to convert date format in filechange of date format in awk commandDate change format in unixRetrieve first hour in daylight savings change - GNU dateps output with iso date format?Format date output minutes as the fraction of an hour
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
Apparently a recent change (in Glibc 2.29?) causes the date
command to start printing times in 12-hour format:
$ date
Fri 23 Aug 2019 07:34:13 PM PDT
This is for my default locale
$ cat /etc/locale.conf
LANG=en_US.UTF-8
How can I configure my system to go back to displaying dates in 24-hour format?
upgrade date locale glibc
add a comment |
Apparently a recent change (in Glibc 2.29?) causes the date
command to start printing times in 12-hour format:
$ date
Fri 23 Aug 2019 07:34:13 PM PDT
This is for my default locale
$ cat /etc/locale.conf
LANG=en_US.UTF-8
How can I configure my system to go back to displaying dates in 24-hour format?
upgrade date locale glibc
What is LC_TIME set to, if anything? (Ref: gnu.org/software/coreutils/manual/html_node/…)
– Jeff Schaller♦
yesterday
Same as LANG ...
– Metamorphic
yesterday
2
See sourceware.org/bugzilla/show_bug.cgi?id=24046 for the origin of the change.
– Stéphane Chazelas
23 hours ago
add a comment |
Apparently a recent change (in Glibc 2.29?) causes the date
command to start printing times in 12-hour format:
$ date
Fri 23 Aug 2019 07:34:13 PM PDT
This is for my default locale
$ cat /etc/locale.conf
LANG=en_US.UTF-8
How can I configure my system to go back to displaying dates in 24-hour format?
upgrade date locale glibc
Apparently a recent change (in Glibc 2.29?) causes the date
command to start printing times in 12-hour format:
$ date
Fri 23 Aug 2019 07:34:13 PM PDT
This is for my default locale
$ cat /etc/locale.conf
LANG=en_US.UTF-8
How can I configure my system to go back to displaying dates in 24-hour format?
upgrade date locale glibc
upgrade date locale glibc
asked yesterday
MetamorphicMetamorphic
4042 silver badges13 bronze badges
4042 silver badges13 bronze badges
What is LC_TIME set to, if anything? (Ref: gnu.org/software/coreutils/manual/html_node/…)
– Jeff Schaller♦
yesterday
Same as LANG ...
– Metamorphic
yesterday
2
See sourceware.org/bugzilla/show_bug.cgi?id=24046 for the origin of the change.
– Stéphane Chazelas
23 hours ago
add a comment |
What is LC_TIME set to, if anything? (Ref: gnu.org/software/coreutils/manual/html_node/…)
– Jeff Schaller♦
yesterday
Same as LANG ...
– Metamorphic
yesterday
2
See sourceware.org/bugzilla/show_bug.cgi?id=24046 for the origin of the change.
– Stéphane Chazelas
23 hours ago
What is LC_TIME set to, if anything? (Ref: gnu.org/software/coreutils/manual/html_node/…)
– Jeff Schaller♦
yesterday
What is LC_TIME set to, if anything? (Ref: gnu.org/software/coreutils/manual/html_node/…)
– Jeff Schaller♦
yesterday
Same as LANG ...
– Metamorphic
yesterday
Same as LANG ...
– Metamorphic
yesterday
2
2
See sourceware.org/bugzilla/show_bug.cgi?id=24046 for the origin of the change.
– Stéphane Chazelas
23 hours ago
See sourceware.org/bugzilla/show_bug.cgi?id=24046 for the origin of the change.
– Stéphane Chazelas
23 hours ago
add a comment |
1 Answer
1
active
oldest
votes
As suggested by jamespharvey20 on IRC, I just changed LC_TIME
to another locale. I set it in /etc/locale.conf
:
$ cat /etc/locale.conf
LANG=en_US.UTF-8
LC_TIME=en_GB
I also exported this value of LC_TIME
in my shell profile, to avoid having to restart (I couldn't figure out how to get Systemd to reread the locale.conf
). This seems a bit hacky but I think it's the best we came up with. Also, it preserves the new "DD MMM" format which I prefer to the old "MMM DD".
That also has the benefit of convertingstrftime("%c / %X")
(like indate +%c/%X
) to 24-hour format. You would have had 12-hour format in US locales even in older versions of glibc. Alternatively, you can useLC_TIME=C
which would be more future-proof as the format is specified by POSIX and unlikely to change (and happens to be in English)
– Stéphane Chazelas
23 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f537167%2fhow-do-i-change-the-output-of-date-back-to-24-hour-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As suggested by jamespharvey20 on IRC, I just changed LC_TIME
to another locale. I set it in /etc/locale.conf
:
$ cat /etc/locale.conf
LANG=en_US.UTF-8
LC_TIME=en_GB
I also exported this value of LC_TIME
in my shell profile, to avoid having to restart (I couldn't figure out how to get Systemd to reread the locale.conf
). This seems a bit hacky but I think it's the best we came up with. Also, it preserves the new "DD MMM" format which I prefer to the old "MMM DD".
That also has the benefit of convertingstrftime("%c / %X")
(like indate +%c/%X
) to 24-hour format. You would have had 12-hour format in US locales even in older versions of glibc. Alternatively, you can useLC_TIME=C
which would be more future-proof as the format is specified by POSIX and unlikely to change (and happens to be in English)
– Stéphane Chazelas
23 hours ago
add a comment |
As suggested by jamespharvey20 on IRC, I just changed LC_TIME
to another locale. I set it in /etc/locale.conf
:
$ cat /etc/locale.conf
LANG=en_US.UTF-8
LC_TIME=en_GB
I also exported this value of LC_TIME
in my shell profile, to avoid having to restart (I couldn't figure out how to get Systemd to reread the locale.conf
). This seems a bit hacky but I think it's the best we came up with. Also, it preserves the new "DD MMM" format which I prefer to the old "MMM DD".
That also has the benefit of convertingstrftime("%c / %X")
(like indate +%c/%X
) to 24-hour format. You would have had 12-hour format in US locales even in older versions of glibc. Alternatively, you can useLC_TIME=C
which would be more future-proof as the format is specified by POSIX and unlikely to change (and happens to be in English)
– Stéphane Chazelas
23 hours ago
add a comment |
As suggested by jamespharvey20 on IRC, I just changed LC_TIME
to another locale. I set it in /etc/locale.conf
:
$ cat /etc/locale.conf
LANG=en_US.UTF-8
LC_TIME=en_GB
I also exported this value of LC_TIME
in my shell profile, to avoid having to restart (I couldn't figure out how to get Systemd to reread the locale.conf
). This seems a bit hacky but I think it's the best we came up with. Also, it preserves the new "DD MMM" format which I prefer to the old "MMM DD".
As suggested by jamespharvey20 on IRC, I just changed LC_TIME
to another locale. I set it in /etc/locale.conf
:
$ cat /etc/locale.conf
LANG=en_US.UTF-8
LC_TIME=en_GB
I also exported this value of LC_TIME
in my shell profile, to avoid having to restart (I couldn't figure out how to get Systemd to reread the locale.conf
). This seems a bit hacky but I think it's the best we came up with. Also, it preserves the new "DD MMM" format which I prefer to the old "MMM DD".
answered yesterday
MetamorphicMetamorphic
4042 silver badges13 bronze badges
4042 silver badges13 bronze badges
That also has the benefit of convertingstrftime("%c / %X")
(like indate +%c/%X
) to 24-hour format. You would have had 12-hour format in US locales even in older versions of glibc. Alternatively, you can useLC_TIME=C
which would be more future-proof as the format is specified by POSIX and unlikely to change (and happens to be in English)
– Stéphane Chazelas
23 hours ago
add a comment |
That also has the benefit of convertingstrftime("%c / %X")
(like indate +%c/%X
) to 24-hour format. You would have had 12-hour format in US locales even in older versions of glibc. Alternatively, you can useLC_TIME=C
which would be more future-proof as the format is specified by POSIX and unlikely to change (and happens to be in English)
– Stéphane Chazelas
23 hours ago
That also has the benefit of converting
strftime("%c / %X")
(like in date +%c/%X
) to 24-hour format. You would have had 12-hour format in US locales even in older versions of glibc. Alternatively, you can use LC_TIME=C
which would be more future-proof as the format is specified by POSIX and unlikely to change (and happens to be in English)– Stéphane Chazelas
23 hours ago
That also has the benefit of converting
strftime("%c / %X")
(like in date +%c/%X
) to 24-hour format. You would have had 12-hour format in US locales even in older versions of glibc. Alternatively, you can use LC_TIME=C
which would be more future-proof as the format is specified by POSIX and unlikely to change (and happens to be in English)– Stéphane Chazelas
23 hours ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f537167%2fhow-do-i-change-the-output-of-date-back-to-24-hour-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What is LC_TIME set to, if anything? (Ref: gnu.org/software/coreutils/manual/html_node/…)
– Jeff Schaller♦
yesterday
Same as LANG ...
– Metamorphic
yesterday
2
See sourceware.org/bugzilla/show_bug.cgi?id=24046 for the origin of the change.
– Stéphane Chazelas
23 hours ago