Is locale also supported by the Linux kernel?
In Linux, timer is supported by kernel. Time is relate to locale. Is locale also supported by the Linux kernel, or a user-space construct; the kernel doesn’t care about that? Thanks.
linux linux-kernel locale
add a comment |
In Linux, timer is supported by kernel. Time is relate to locale. Is locale also supported by the Linux kernel, or a user-space construct; the kernel doesn’t care about that? Thanks.
linux linux-kernel locale
No, the kernel has absolutely no idea of locales or of the (unrelated) time zones. The kernel keeps the time in UTC (even when the real time clock is set to local time), and the userland does the transformation based on user's settings. Different users can use different time zones and everything's fine.
– mosvy
Dec 31 '18 at 13:28
@mosvy I don't think kernel cares about UTC or local time, it just keeps the time, interpretation of this wall time value purely depends on userland.
– 炸鱼薯条德里克
Jan 1 at 11:07
@炸鱼薯条德里克 what's the point of your comment? are you suggesting that you can configure the userland to treat the time it gets from the kernel as anything else than Epoch/UTC? That's not possible.gettimeofday(2)
andtime(2)
always return seconds since 1.1.1970 UTC. The kernel has some workarounds for filesystems that are using localtime but that, while interesting, is completely irrelevant.
– mosvy
Jan 1 at 12:51
add a comment |
In Linux, timer is supported by kernel. Time is relate to locale. Is locale also supported by the Linux kernel, or a user-space construct; the kernel doesn’t care about that? Thanks.
linux linux-kernel locale
In Linux, timer is supported by kernel. Time is relate to locale. Is locale also supported by the Linux kernel, or a user-space construct; the kernel doesn’t care about that? Thanks.
linux linux-kernel locale
linux linux-kernel locale
asked Dec 31 '18 at 13:03
TimTim
26.3k75247456
26.3k75247456
No, the kernel has absolutely no idea of locales or of the (unrelated) time zones. The kernel keeps the time in UTC (even when the real time clock is set to local time), and the userland does the transformation based on user's settings. Different users can use different time zones and everything's fine.
– mosvy
Dec 31 '18 at 13:28
@mosvy I don't think kernel cares about UTC or local time, it just keeps the time, interpretation of this wall time value purely depends on userland.
– 炸鱼薯条德里克
Jan 1 at 11:07
@炸鱼薯条德里克 what's the point of your comment? are you suggesting that you can configure the userland to treat the time it gets from the kernel as anything else than Epoch/UTC? That's not possible.gettimeofday(2)
andtime(2)
always return seconds since 1.1.1970 UTC. The kernel has some workarounds for filesystems that are using localtime but that, while interesting, is completely irrelevant.
– mosvy
Jan 1 at 12:51
add a comment |
No, the kernel has absolutely no idea of locales or of the (unrelated) time zones. The kernel keeps the time in UTC (even when the real time clock is set to local time), and the userland does the transformation based on user's settings. Different users can use different time zones and everything's fine.
– mosvy
Dec 31 '18 at 13:28
@mosvy I don't think kernel cares about UTC or local time, it just keeps the time, interpretation of this wall time value purely depends on userland.
– 炸鱼薯条德里克
Jan 1 at 11:07
@炸鱼薯条德里克 what's the point of your comment? are you suggesting that you can configure the userland to treat the time it gets from the kernel as anything else than Epoch/UTC? That's not possible.gettimeofday(2)
andtime(2)
always return seconds since 1.1.1970 UTC. The kernel has some workarounds for filesystems that are using localtime but that, while interesting, is completely irrelevant.
– mosvy
Jan 1 at 12:51
No, the kernel has absolutely no idea of locales or of the (unrelated) time zones. The kernel keeps the time in UTC (even when the real time clock is set to local time), and the userland does the transformation based on user's settings. Different users can use different time zones and everything's fine.
– mosvy
Dec 31 '18 at 13:28
No, the kernel has absolutely no idea of locales or of the (unrelated) time zones. The kernel keeps the time in UTC (even when the real time clock is set to local time), and the userland does the transformation based on user's settings. Different users can use different time zones and everything's fine.
– mosvy
Dec 31 '18 at 13:28
@mosvy I don't think kernel cares about UTC or local time, it just keeps the time, interpretation of this wall time value purely depends on userland.
– 炸鱼薯条德里克
Jan 1 at 11:07
@mosvy I don't think kernel cares about UTC or local time, it just keeps the time, interpretation of this wall time value purely depends on userland.
– 炸鱼薯条德里克
Jan 1 at 11:07
@炸鱼薯条德里克 what's the point of your comment? are you suggesting that you can configure the userland to treat the time it gets from the kernel as anything else than Epoch/UTC? That's not possible.
gettimeofday(2)
and time(2)
always return seconds since 1.1.1970 UTC. The kernel has some workarounds for filesystems that are using localtime but that, while interesting, is completely irrelevant.– mosvy
Jan 1 at 12:51
@炸鱼薯条德里克 what's the point of your comment? are you suggesting that you can configure the userland to treat the time it gets from the kernel as anything else than Epoch/UTC? That's not possible.
gettimeofday(2)
and time(2)
always return seconds since 1.1.1970 UTC. The kernel has some workarounds for filesystems that are using localtime but that, while interesting, is completely irrelevant.– mosvy
Jan 1 at 12:51
add a comment |
1 Answer
1
active
oldest
votes
The Linux kernel tracks seconds past 1/1/1970 00:00:00 UTC, commonly called "epoch time". There's some kludges around leap seconds, but that's about it.
There's a second kludge for how this time value gets initialised from the hardware real-time clock (RTC) at boot time because the RTC may not be set to UTC. (Thanks, Microsoft).
Timezones, locales and similar are all user space constructs and not part of the kernel.
@derobert Indeed, silly me. Too long without using MS "#$"#$.
– Rui F Ribeiro
Dec 31 '18 at 13:43
1
@RuiFRibeiro BTW, Windows has supported RTC set to UTC since at least 7. superuser.com/questions/975717/… has 10, and links to 7 & 8
– derobert
Dec 31 '18 at 13:44
@derobert Thanks for the comments....off-topic: fortunately no Windows on sight at home, and negociated from day 0 a Mac or Linux corporate notebook...we are maybe half a dozen users using Linux out of thousands of people.
– Rui F Ribeiro
Dec 31 '18 at 13:49
We should not thank Microsoft without also thanking the hardware vendors that make systems without real-time clocks. (-: Also note that there are timezones in the kernel, in a filesystem that you may have heard of. jdebp.eu./Softwares/nosh/guide/system-manager.html#SystemClock
– JdeBP
Dec 31 '18 at 16:03
It seems that kernel DO has a part related to timezone, although it's obsolete and nobody ever use it. man7.org/linux/man-pages/man2/gettimeofday.2.html
– 炸鱼薯条德里克
Jan 1 at 11:01
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%2f491760%2fis-locale-also-supported-by-the-linux-kernel%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
The Linux kernel tracks seconds past 1/1/1970 00:00:00 UTC, commonly called "epoch time". There's some kludges around leap seconds, but that's about it.
There's a second kludge for how this time value gets initialised from the hardware real-time clock (RTC) at boot time because the RTC may not be set to UTC. (Thanks, Microsoft).
Timezones, locales and similar are all user space constructs and not part of the kernel.
@derobert Indeed, silly me. Too long without using MS "#$"#$.
– Rui F Ribeiro
Dec 31 '18 at 13:43
1
@RuiFRibeiro BTW, Windows has supported RTC set to UTC since at least 7. superuser.com/questions/975717/… has 10, and links to 7 & 8
– derobert
Dec 31 '18 at 13:44
@derobert Thanks for the comments....off-topic: fortunately no Windows on sight at home, and negociated from day 0 a Mac or Linux corporate notebook...we are maybe half a dozen users using Linux out of thousands of people.
– Rui F Ribeiro
Dec 31 '18 at 13:49
We should not thank Microsoft without also thanking the hardware vendors that make systems without real-time clocks. (-: Also note that there are timezones in the kernel, in a filesystem that you may have heard of. jdebp.eu./Softwares/nosh/guide/system-manager.html#SystemClock
– JdeBP
Dec 31 '18 at 16:03
It seems that kernel DO has a part related to timezone, although it's obsolete and nobody ever use it. man7.org/linux/man-pages/man2/gettimeofday.2.html
– 炸鱼薯条德里克
Jan 1 at 11:01
add a comment |
The Linux kernel tracks seconds past 1/1/1970 00:00:00 UTC, commonly called "epoch time". There's some kludges around leap seconds, but that's about it.
There's a second kludge for how this time value gets initialised from the hardware real-time clock (RTC) at boot time because the RTC may not be set to UTC. (Thanks, Microsoft).
Timezones, locales and similar are all user space constructs and not part of the kernel.
@derobert Indeed, silly me. Too long without using MS "#$"#$.
– Rui F Ribeiro
Dec 31 '18 at 13:43
1
@RuiFRibeiro BTW, Windows has supported RTC set to UTC since at least 7. superuser.com/questions/975717/… has 10, and links to 7 & 8
– derobert
Dec 31 '18 at 13:44
@derobert Thanks for the comments....off-topic: fortunately no Windows on sight at home, and negociated from day 0 a Mac or Linux corporate notebook...we are maybe half a dozen users using Linux out of thousands of people.
– Rui F Ribeiro
Dec 31 '18 at 13:49
We should not thank Microsoft without also thanking the hardware vendors that make systems without real-time clocks. (-: Also note that there are timezones in the kernel, in a filesystem that you may have heard of. jdebp.eu./Softwares/nosh/guide/system-manager.html#SystemClock
– JdeBP
Dec 31 '18 at 16:03
It seems that kernel DO has a part related to timezone, although it's obsolete and nobody ever use it. man7.org/linux/man-pages/man2/gettimeofday.2.html
– 炸鱼薯条德里克
Jan 1 at 11:01
add a comment |
The Linux kernel tracks seconds past 1/1/1970 00:00:00 UTC, commonly called "epoch time". There's some kludges around leap seconds, but that's about it.
There's a second kludge for how this time value gets initialised from the hardware real-time clock (RTC) at boot time because the RTC may not be set to UTC. (Thanks, Microsoft).
Timezones, locales and similar are all user space constructs and not part of the kernel.
The Linux kernel tracks seconds past 1/1/1970 00:00:00 UTC, commonly called "epoch time". There's some kludges around leap seconds, but that's about it.
There's a second kludge for how this time value gets initialised from the hardware real-time clock (RTC) at boot time because the RTC may not be set to UTC. (Thanks, Microsoft).
Timezones, locales and similar are all user space constructs and not part of the kernel.
answered Dec 31 '18 at 13:30
Stephen HarrisStephen Harris
25.3k24477
25.3k24477
@derobert Indeed, silly me. Too long without using MS "#$"#$.
– Rui F Ribeiro
Dec 31 '18 at 13:43
1
@RuiFRibeiro BTW, Windows has supported RTC set to UTC since at least 7. superuser.com/questions/975717/… has 10, and links to 7 & 8
– derobert
Dec 31 '18 at 13:44
@derobert Thanks for the comments....off-topic: fortunately no Windows on sight at home, and negociated from day 0 a Mac or Linux corporate notebook...we are maybe half a dozen users using Linux out of thousands of people.
– Rui F Ribeiro
Dec 31 '18 at 13:49
We should not thank Microsoft without also thanking the hardware vendors that make systems without real-time clocks. (-: Also note that there are timezones in the kernel, in a filesystem that you may have heard of. jdebp.eu./Softwares/nosh/guide/system-manager.html#SystemClock
– JdeBP
Dec 31 '18 at 16:03
It seems that kernel DO has a part related to timezone, although it's obsolete and nobody ever use it. man7.org/linux/man-pages/man2/gettimeofday.2.html
– 炸鱼薯条德里克
Jan 1 at 11:01
add a comment |
@derobert Indeed, silly me. Too long without using MS "#$"#$.
– Rui F Ribeiro
Dec 31 '18 at 13:43
1
@RuiFRibeiro BTW, Windows has supported RTC set to UTC since at least 7. superuser.com/questions/975717/… has 10, and links to 7 & 8
– derobert
Dec 31 '18 at 13:44
@derobert Thanks for the comments....off-topic: fortunately no Windows on sight at home, and negociated from day 0 a Mac or Linux corporate notebook...we are maybe half a dozen users using Linux out of thousands of people.
– Rui F Ribeiro
Dec 31 '18 at 13:49
We should not thank Microsoft without also thanking the hardware vendors that make systems without real-time clocks. (-: Also note that there are timezones in the kernel, in a filesystem that you may have heard of. jdebp.eu./Softwares/nosh/guide/system-manager.html#SystemClock
– JdeBP
Dec 31 '18 at 16:03
It seems that kernel DO has a part related to timezone, although it's obsolete and nobody ever use it. man7.org/linux/man-pages/man2/gettimeofday.2.html
– 炸鱼薯条德里克
Jan 1 at 11:01
@derobert Indeed, silly me. Too long without using MS "#$"#$.
– Rui F Ribeiro
Dec 31 '18 at 13:43
@derobert Indeed, silly me. Too long without using MS "#$"#$.
– Rui F Ribeiro
Dec 31 '18 at 13:43
1
1
@RuiFRibeiro BTW, Windows has supported RTC set to UTC since at least 7. superuser.com/questions/975717/… has 10, and links to 7 & 8
– derobert
Dec 31 '18 at 13:44
@RuiFRibeiro BTW, Windows has supported RTC set to UTC since at least 7. superuser.com/questions/975717/… has 10, and links to 7 & 8
– derobert
Dec 31 '18 at 13:44
@derobert Thanks for the comments....off-topic: fortunately no Windows on sight at home, and negociated from day 0 a Mac or Linux corporate notebook...we are maybe half a dozen users using Linux out of thousands of people.
– Rui F Ribeiro
Dec 31 '18 at 13:49
@derobert Thanks for the comments....off-topic: fortunately no Windows on sight at home, and negociated from day 0 a Mac or Linux corporate notebook...we are maybe half a dozen users using Linux out of thousands of people.
– Rui F Ribeiro
Dec 31 '18 at 13:49
We should not thank Microsoft without also thanking the hardware vendors that make systems without real-time clocks. (-: Also note that there are timezones in the kernel, in a filesystem that you may have heard of. jdebp.eu./Softwares/nosh/guide/system-manager.html#SystemClock
– JdeBP
Dec 31 '18 at 16:03
We should not thank Microsoft without also thanking the hardware vendors that make systems without real-time clocks. (-: Also note that there are timezones in the kernel, in a filesystem that you may have heard of. jdebp.eu./Softwares/nosh/guide/system-manager.html#SystemClock
– JdeBP
Dec 31 '18 at 16:03
It seems that kernel DO has a part related to timezone, although it's obsolete and nobody ever use it. man7.org/linux/man-pages/man2/gettimeofday.2.html
– 炸鱼薯条德里克
Jan 1 at 11:01
It seems that kernel DO has a part related to timezone, although it's obsolete and nobody ever use it. man7.org/linux/man-pages/man2/gettimeofday.2.html
– 炸鱼薯条德里克
Jan 1 at 11:01
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%2f491760%2fis-locale-also-supported-by-the-linux-kernel%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
No, the kernel has absolutely no idea of locales or of the (unrelated) time zones. The kernel keeps the time in UTC (even when the real time clock is set to local time), and the userland does the transformation based on user's settings. Different users can use different time zones and everything's fine.
– mosvy
Dec 31 '18 at 13:28
@mosvy I don't think kernel cares about UTC or local time, it just keeps the time, interpretation of this wall time value purely depends on userland.
– 炸鱼薯条德里克
Jan 1 at 11:07
@炸鱼薯条德里克 what's the point of your comment? are you suggesting that you can configure the userland to treat the time it gets from the kernel as anything else than Epoch/UTC? That's not possible.
gettimeofday(2)
andtime(2)
always return seconds since 1.1.1970 UTC. The kernel has some workarounds for filesystems that are using localtime but that, while interesting, is completely irrelevant.– mosvy
Jan 1 at 12:51