Comments (8)
Yeah, having TZ
set to UTC
will do that.
It's probably set somewhere in your bash profile/rc, or the global one. There are some tips on finding out where it may have came from here: https://unix.stackexchange.com/q/813/10762
For now, you can also do unset TZ; date
.
from tzupdate.
It works! Thank you so much.
I've been banging my head on the wall for a while, because of this ;)
from tzupdate.
Huh, that's intriguing. If tzupdate exited without error, it should have done the same thing.
What does stat /etc/localtime
say? Which distribution is this?
from tzupdate.
It's Ubuntu 16.04.
stat /etc/localtime
File: '/etc/localtime' -> '/usr/share/zoneinfo/America/New_York'
Size: 36 Blocks: 0 IO Block: 4096 symbolic link
Device: 5fh/95d Inode: 1300 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-01-15 21:30:35.980517343 +0000
Modify: 2018-01-15 21:30:35.980517343 +0000
Change: 2018-01-15 21:30:35.980517343 +0000
Birth: -
from tzupdate.
Does this same behaviour occur with dpkg-reconfigure tzdata
with "real" root and sudo?
from tzupdate.
dpkg-reconfigure tzdata seems to be interactive, it's ok like that?
So I choose America/New-York for my first test. Here are the results...
If I run as "real" root:
...
Current default time zone: 'America/New_York'
Local time is now: Mon Jan 15 19:11:05 EST 2018.
Universal Time is now: Tue Jan 16 00:11:05 UTC 2018.
date
Mon Jan 15 19:11:12 EST 2018
If I run as "sudo" (let's try Antartica):
...
Current default time zone: 'Antarctica/Davis'
Local time is now: Tue Jan 16 07:15:35 +07 2018.
Universal Time is now: Tue Jan 16 00:15:35 UTC 2018.
date
Tue Jan 16 00:16:18 UTC 2018
So this answer your question: Yes it seems like I'm having the same problem when I run your command. Why is it?
I also noticed something strange:
If I run the "date" command as root, I see actual date/time.
If I run the "date" command as sudo, I see UTC time!
So the user and root don't even have the same time... Isn't it weird?
For user, it seems like no matter what I try, it keeps showing UTC time.
from tzupdate.
What's the output of env
and type date
as root and your user?
from tzupdate.
as user:
env
SCREEN_HEIGHT=1020
HOSTNAME=zeck
DEBCONF_NONINTERACTIVE_SEEN=true
TERM=screen-256color
SCREEN_WIDTH=1360
LC_ALL=en_US.UTF-8
LS_COLORS=(removed for readability)
COLUMNS=268
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/home
NODE_UNREGISTER_IF_STILL_DOWN_AFTER=60000
SCREEN_DEPTH=24
LANG=en_US.UTF-8
TZ=UTC
LINES=74
HOME=/home/erik
LANGUAGE=en_US:en
DBUS_SESSION_BUS_ADDRESS=/dev/null
DEBIAN_FRONTEND=noninteractive
DISPLAY=:99.0
_=/usr/bin/env
type date
date is /bin/date
As root:
env
SHELL=/bin/bash
TERM=screen-256color
USER=root
LS_COLORS=(removed for readability)
MAIL=/var/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/root
HOME=/root
LOGNAME=root
DISPLAY=:99.0
_=/usr/bin/env
date
date is /bin/date
Note: I see that regular user has env variable "TZ" set to "UTC".
Why is it?
(thanks for helping, btw)
from tzupdate.
Related Issues (20)
- Split the python version and the rust version into two separate projects. HOT 5
- Automatically set timezone when nework becomes available
- Add a service file to change the timezone on boot HOT 4
- Error in tzupdate HOT 7
- first launch onAarch after clone from AUR and makepkg -si HOT 2
- version 2.0.0 compatibility issues python2/3 symlink HOT 4
- SSL error message when running tzupdate with python 3.8 HOT 5
- Add to documentation HOT 1
- Invalid syntax HOT 2
- Debian10&Kali linux HOT 1
- Error Exception on Fail to connect to Internet HOT 4
- SyntaxError on Docker Debian:buster-slim HOT 1
- Add this terrific documentation HOT 1
- `http://ip-api.com/json/{ip}` gives inaccurate responses HOT 1
- "No module named 'tzupdate'" HOT 4
- Allow pulling out timezone APIs from code
- Add --consensus instead of picking first
- If all services failed, fail quickly instead of timing out
- Proposal: Add Timezone Information from Free IP2Location.io API HOT 2
- Previous timezone not cleared HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tzupdate.