Why does “date” show different times in root and user?
Using dpkg-reconfigure tzdata
I have set my timezone to CST, but for non root users the system persists in using UTC time.
pi@raspberry ~ $ date
Wed Oct 28 18:14:08 UTC 2015
root@raspberrypi:/home/pi# date
Wed Oct 28 12:14:08 CST 2015
The problem is also evident in LXPanel Digital Clock and timestamps in Epiphany web pages.
How can I force system time not to use UTC but to use the timezone time I set with tzdata, which is CST?
debian date raspbian timezone
migrated from raspberrypi.stackexchange.com Oct 28 '15 at 18:59
This question came from our site for users and developers of hardware and software for Raspberry Pi.
add a comment |
Using dpkg-reconfigure tzdata
I have set my timezone to CST, but for non root users the system persists in using UTC time.
pi@raspberry ~ $ date
Wed Oct 28 18:14:08 UTC 2015
root@raspberrypi:/home/pi# date
Wed Oct 28 12:14:08 CST 2015
The problem is also evident in LXPanel Digital Clock and timestamps in Epiphany web pages.
How can I force system time not to use UTC but to use the timezone time I set with tzdata, which is CST?
debian date raspbian timezone
migrated from raspberrypi.stackexchange.com Oct 28 '15 at 18:59
This question came from our site for users and developers of hardware and software for Raspberry Pi.
1
is there any evidence that the non-root user's login scripts are setting TZ themselves?grep TZ ~/.[a-z]*
(for example)
– Jeff Schaller
Oct 28 '15 at 19:14
1
What doesecho $TZ
say when run as each user?
– cjm
Oct 28 '15 at 19:47
1
UTC is often a better option for systems, as it doesn't have the stupidity of doubled or eliminated hours thanks to Daylight Saving Time. Are you really sure you need a local timezone that may cause errors or lost data twice per year?
– thrig
Oct 28 '15 at 21:41
Have you tried setting the Time Zone in the recommended way i.e. raspi-config?
– Milliways
Oct 29 '15 at 4:34
All raspi-config does is rundpkg-reconfigure locales
anddpkg-reconfigure tzdata
.
– goldilocks
Oct 31 '15 at 2:44
add a comment |
Using dpkg-reconfigure tzdata
I have set my timezone to CST, but for non root users the system persists in using UTC time.
pi@raspberry ~ $ date
Wed Oct 28 18:14:08 UTC 2015
root@raspberrypi:/home/pi# date
Wed Oct 28 12:14:08 CST 2015
The problem is also evident in LXPanel Digital Clock and timestamps in Epiphany web pages.
How can I force system time not to use UTC but to use the timezone time I set with tzdata, which is CST?
debian date raspbian timezone
Using dpkg-reconfigure tzdata
I have set my timezone to CST, but for non root users the system persists in using UTC time.
pi@raspberry ~ $ date
Wed Oct 28 18:14:08 UTC 2015
root@raspberrypi:/home/pi# date
Wed Oct 28 12:14:08 CST 2015
The problem is also evident in LXPanel Digital Clock and timestamps in Epiphany web pages.
How can I force system time not to use UTC but to use the timezone time I set with tzdata, which is CST?
debian date raspbian timezone
debian date raspbian timezone
edited Oct 28 '15 at 19:00
goldilocks
62k14151209
62k14151209
asked Oct 28 '15 at 18:40
Peter Strong
migrated from raspberrypi.stackexchange.com Oct 28 '15 at 18:59
This question came from our site for users and developers of hardware and software for Raspberry Pi.
migrated from raspberrypi.stackexchange.com Oct 28 '15 at 18:59
This question came from our site for users and developers of hardware and software for Raspberry Pi.
1
is there any evidence that the non-root user's login scripts are setting TZ themselves?grep TZ ~/.[a-z]*
(for example)
– Jeff Schaller
Oct 28 '15 at 19:14
1
What doesecho $TZ
say when run as each user?
– cjm
Oct 28 '15 at 19:47
1
UTC is often a better option for systems, as it doesn't have the stupidity of doubled or eliminated hours thanks to Daylight Saving Time. Are you really sure you need a local timezone that may cause errors or lost data twice per year?
– thrig
Oct 28 '15 at 21:41
Have you tried setting the Time Zone in the recommended way i.e. raspi-config?
– Milliways
Oct 29 '15 at 4:34
All raspi-config does is rundpkg-reconfigure locales
anddpkg-reconfigure tzdata
.
– goldilocks
Oct 31 '15 at 2:44
add a comment |
1
is there any evidence that the non-root user's login scripts are setting TZ themselves?grep TZ ~/.[a-z]*
(for example)
– Jeff Schaller
Oct 28 '15 at 19:14
1
What doesecho $TZ
say when run as each user?
– cjm
Oct 28 '15 at 19:47
1
UTC is often a better option for systems, as it doesn't have the stupidity of doubled or eliminated hours thanks to Daylight Saving Time. Are you really sure you need a local timezone that may cause errors or lost data twice per year?
– thrig
Oct 28 '15 at 21:41
Have you tried setting the Time Zone in the recommended way i.e. raspi-config?
– Milliways
Oct 29 '15 at 4:34
All raspi-config does is rundpkg-reconfigure locales
anddpkg-reconfigure tzdata
.
– goldilocks
Oct 31 '15 at 2:44
1
1
is there any evidence that the non-root user's login scripts are setting TZ themselves?
grep TZ ~/.[a-z]*
(for example)– Jeff Schaller
Oct 28 '15 at 19:14
is there any evidence that the non-root user's login scripts are setting TZ themselves?
grep TZ ~/.[a-z]*
(for example)– Jeff Schaller
Oct 28 '15 at 19:14
1
1
What does
echo $TZ
say when run as each user?– cjm
Oct 28 '15 at 19:47
What does
echo $TZ
say when run as each user?– cjm
Oct 28 '15 at 19:47
1
1
UTC is often a better option for systems, as it doesn't have the stupidity of doubled or eliminated hours thanks to Daylight Saving Time. Are you really sure you need a local timezone that may cause errors or lost data twice per year?
– thrig
Oct 28 '15 at 21:41
UTC is often a better option for systems, as it doesn't have the stupidity of doubled or eliminated hours thanks to Daylight Saving Time. Are you really sure you need a local timezone that may cause errors or lost data twice per year?
– thrig
Oct 28 '15 at 21:41
Have you tried setting the Time Zone in the recommended way i.e. raspi-config?
– Milliways
Oct 29 '15 at 4:34
Have you tried setting the Time Zone in the recommended way i.e. raspi-config?
– Milliways
Oct 29 '15 at 4:34
All raspi-config does is run
dpkg-reconfigure locales
and dpkg-reconfigure tzdata
.– goldilocks
Oct 31 '15 at 2:44
All raspi-config does is run
dpkg-reconfigure locales
and dpkg-reconfigure tzdata
.– goldilocks
Oct 31 '15 at 2:44
add a comment |
2 Answers
2
active
oldest
votes
Try with the command:
tzconfig
Also check you environmental variables for the non root user:
echo $TZ
In case is different to the desired, edit the file where is defined that variable, could be one of these:
$HOME/.bash_profile
$HOME/.profile
$HOME/.bashrc
add a comment |
I've just fixed this in RHEL7 for a user who had the UTC time set correctly, but didn't apply the CEST part. The fix was changing the permissions to /etc/localtime from 600
to 644
so that other users apart from root could use it. Therefore, something like:
chmod 0644 /etc/localtime
should to the trick, if that was your problem.
Here is the relevant article from Redhat:
https://access.redhat.com/solutions/2428001
1
Is that RedHat that sets those 0600 incorrect permissions?
– Stéphane Chazelas
Jan 24 at 17:17
I'm not sure, sorry. It's probably a mix of using system tools and editing files manually that doesn't gel properly, but again, not sure
– pHonta
Jan 24 at 17:19
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%2f239294%2fwhy-does-date-show-different-times-in-root-and-user%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try with the command:
tzconfig
Also check you environmental variables for the non root user:
echo $TZ
In case is different to the desired, edit the file where is defined that variable, could be one of these:
$HOME/.bash_profile
$HOME/.profile
$HOME/.bashrc
add a comment |
Try with the command:
tzconfig
Also check you environmental variables for the non root user:
echo $TZ
In case is different to the desired, edit the file where is defined that variable, could be one of these:
$HOME/.bash_profile
$HOME/.profile
$HOME/.bashrc
add a comment |
Try with the command:
tzconfig
Also check you environmental variables for the non root user:
echo $TZ
In case is different to the desired, edit the file where is defined that variable, could be one of these:
$HOME/.bash_profile
$HOME/.profile
$HOME/.bashrc
Try with the command:
tzconfig
Also check you environmental variables for the non root user:
echo $TZ
In case is different to the desired, edit the file where is defined that variable, could be one of these:
$HOME/.bash_profile
$HOME/.profile
$HOME/.bashrc
answered Oct 28 '15 at 21:53
alanbaloalanbalo
761
761
add a comment |
add a comment |
I've just fixed this in RHEL7 for a user who had the UTC time set correctly, but didn't apply the CEST part. The fix was changing the permissions to /etc/localtime from 600
to 644
so that other users apart from root could use it. Therefore, something like:
chmod 0644 /etc/localtime
should to the trick, if that was your problem.
Here is the relevant article from Redhat:
https://access.redhat.com/solutions/2428001
1
Is that RedHat that sets those 0600 incorrect permissions?
– Stéphane Chazelas
Jan 24 at 17:17
I'm not sure, sorry. It's probably a mix of using system tools and editing files manually that doesn't gel properly, but again, not sure
– pHonta
Jan 24 at 17:19
add a comment |
I've just fixed this in RHEL7 for a user who had the UTC time set correctly, but didn't apply the CEST part. The fix was changing the permissions to /etc/localtime from 600
to 644
so that other users apart from root could use it. Therefore, something like:
chmod 0644 /etc/localtime
should to the trick, if that was your problem.
Here is the relevant article from Redhat:
https://access.redhat.com/solutions/2428001
1
Is that RedHat that sets those 0600 incorrect permissions?
– Stéphane Chazelas
Jan 24 at 17:17
I'm not sure, sorry. It's probably a mix of using system tools and editing files manually that doesn't gel properly, but again, not sure
– pHonta
Jan 24 at 17:19
add a comment |
I've just fixed this in RHEL7 for a user who had the UTC time set correctly, but didn't apply the CEST part. The fix was changing the permissions to /etc/localtime from 600
to 644
so that other users apart from root could use it. Therefore, something like:
chmod 0644 /etc/localtime
should to the trick, if that was your problem.
Here is the relevant article from Redhat:
https://access.redhat.com/solutions/2428001
I've just fixed this in RHEL7 for a user who had the UTC time set correctly, but didn't apply the CEST part. The fix was changing the permissions to /etc/localtime from 600
to 644
so that other users apart from root could use it. Therefore, something like:
chmod 0644 /etc/localtime
should to the trick, if that was your problem.
Here is the relevant article from Redhat:
https://access.redhat.com/solutions/2428001
edited Jan 24 at 17:14
answered Oct 9 '18 at 7:33
pHontapHonta
1113
1113
1
Is that RedHat that sets those 0600 incorrect permissions?
– Stéphane Chazelas
Jan 24 at 17:17
I'm not sure, sorry. It's probably a mix of using system tools and editing files manually that doesn't gel properly, but again, not sure
– pHonta
Jan 24 at 17:19
add a comment |
1
Is that RedHat that sets those 0600 incorrect permissions?
– Stéphane Chazelas
Jan 24 at 17:17
I'm not sure, sorry. It's probably a mix of using system tools and editing files manually that doesn't gel properly, but again, not sure
– pHonta
Jan 24 at 17:19
1
1
Is that RedHat that sets those 0600 incorrect permissions?
– Stéphane Chazelas
Jan 24 at 17:17
Is that RedHat that sets those 0600 incorrect permissions?
– Stéphane Chazelas
Jan 24 at 17:17
I'm not sure, sorry. It's probably a mix of using system tools and editing files manually that doesn't gel properly, but again, not sure
– pHonta
Jan 24 at 17:19
I'm not sure, sorry. It's probably a mix of using system tools and editing files manually that doesn't gel properly, but again, not sure
– pHonta
Jan 24 at 17:19
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%2f239294%2fwhy-does-date-show-different-times-in-root-and-user%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
1
is there any evidence that the non-root user's login scripts are setting TZ themselves?
grep TZ ~/.[a-z]*
(for example)– Jeff Schaller
Oct 28 '15 at 19:14
1
What does
echo $TZ
say when run as each user?– cjm
Oct 28 '15 at 19:47
1
UTC is often a better option for systems, as it doesn't have the stupidity of doubled or eliminated hours thanks to Daylight Saving Time. Are you really sure you need a local timezone that may cause errors or lost data twice per year?
– thrig
Oct 28 '15 at 21:41
Have you tried setting the Time Zone in the recommended way i.e. raspi-config?
– Milliways
Oct 29 '15 at 4:34
All raspi-config does is run
dpkg-reconfigure locales
anddpkg-reconfigure tzdata
.– goldilocks
Oct 31 '15 at 2:44