Time reverts 7 hours back after each boot

New to Debian (Or Linux in general)? Ask your questions here!

Time reverts 7 hours back after each boot

Postby lensesSenses » 2019-01-16 20:20

Hello, I just installed Debian 9 and one thing I noticed is that I can't set the time right.
After adjusting the correct time and click 'Set System Time..' button, it changes but after each boot it will go back 7 hours.
I suspect I messed up when I had to select my timezone during installation which I just clicked next.

I also tried with terminal using
Code: Select all
sudo date --set
but the result only stays temporary.
Can you please guide me through fixing the clock? ty
lensesSenses
 
Posts: 3
Joined: 2019-01-16 19:48

Re: Time reverts 7 hours back after each boot

Postby Bulkley » 2019-01-16 20:23

Is the battery any good?
Bulkley
 
Posts: 5723
Joined: 2006-02-11 18:35

Re: Time reverts 7 hours back after each boot

Postby lensesSenses » 2019-01-16 20:27

Bulkley wrote:Is the battery any good?


I should've mentioned I'm on a laptop, do you think I should get the CMOS battery inspected?
lensesSenses
 
Posts: 3
Joined: 2019-01-16 19:48

Re: Time reverts 7 hours back after each boot

Postby sunrat » 2019-01-16 20:32

Is this a dual boot system including Windows?
Is the hardware clock set to UTC or local time?
What time zone are you in, 7 hours different from UTC?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2520
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Time reverts 7 hours back after each boot

Postby lensesSenses » 2019-01-16 21:08

sunrat wrote:Is this a dual boot system including Windows?
Is the hardware clock set to UTC or local time?
What time zone are you in, 7 hours different from UTC?


I had single boot Ubuntu and installed debian over that, using whole drive. It did leave a uefi entry
Hardware clock is set to UTC (should I change it to 'LOCAL' ?)
I'm currently in Athens so I guess this is EET?

hwclock returns the time like this, is this normal?
Code: Select all
# hwclock
2019-01-16 23:46:34.570013-0500
lensesSenses
 
Posts: 3
Joined: 2019-01-16 19:48

Re: Time reverts 7 hours back after each boot

Postby Bulkley » 2019-01-16 22:13

Take a look at ntpdate. If you have an Internet connection you'll never set time on a computer.
Bulkley
 
Posts: 5723
Joined: 2006-02-11 18:35

Re: Time reverts 7 hours back after each boot

Postby sunrat » 2019-01-16 22:26

UTC is default and Athens is UTC +2. Are you sure you have your timezone set correctly? UTC -5 is the time in New York.
Try
Code: Select all
# dpkg-reconfigure tzdata


There's probably some GUI way to do it depending on your DE.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2520
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Time reverts 7 hours back after each boot

Postby Head_on_a_Stick » 2019-01-17 05:38

Code: Select all
timedatectl set-ntp on
"The trouble with the world is that the stupid are cocksure and the intelligent full of doubt." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 8842
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Time reverts 7 hours back after each boot

Postby CwF » 2019-01-17 15:22

Edit /etc/adjtime, and change "UTC" to "LOCAL" if you want the hardware clock to be kept at local time instead of UTC.
CwF
 
Posts: 217
Joined: 2018-06-20 15:16

Re: Time reverts 7 hours back after each boot

Postby llivv » 2019-01-17 15:31

CwF wrote:Edit /etc/adjtime, and change "UTC" to "LOCAL" if you want the hardware clock to be kept at local time instead of UTC.

What is the diff between /etc/adjtime LOCAL and dpkg-reconfigure tzdata?
How does /etc/adjtime know what local time to use?
my time is set to my local time using dpkg-reconfigure tzdata and my /etc/adjtime is set to UTC

I also have /etc/timezone with my local time settings

nice find by the way CwF !

NTP daemon will sync the hwclock to the ntp servers time automagically
although it will not change timezone settings

ntpdate is a debain script to sync to debian ntp servers
but must be run manually every once in a while using
Code: Select all
 /usr/sbin/ntpdate-debian
17 Jan 11:39:26 ntpdate[2187]: step time server 204.9.54.119 offset -8.101395 sec
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.
User avatar
llivv
 
Posts: 5642
Joined: 2007-02-14 18:10
Location: cold storage

Re: Time reverts 7 hours back after each boot

Postby None1975 » 2019-01-18 14:08

llivv wrote:NTP daemon will sync the hwclock to the ntp servers time automagically

This is not necessary. You can use systemd utilities. For example, systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network. It implements an SNTP client. In contrast to NTP implementations such as chrony or the NTP reference server this only implements a client side, and does not bother with the full NTP complexity, focusing only on querying time from one remote server and synchronizing the local clock to it. Unless you intend to serve NTP to networked clients or want to connect to local hardware clocks this simple NTP client should be more than appropriate for most installations.
OS: Debian Stretch / WM: Herbstluftwm
Debian Wiki | DontBreakDebian, My config files in github
User avatar
None1975
 
Posts: 766
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius

Re: Time reverts 7 hours back after each boot

Postby Segfault » 2019-01-18 14:39

Your Debian is hinting it is time to move to Jamaica.
Segfault
 
Posts: 856
Joined: 2005-09-24 12:24

Re: Time reverts 7 hours back after each boot

Postby llivv » 2019-01-22 07:23

Bob Marley wrote:don't worry... / be happy....

Dr E vil wrote:making two (binary compatiable) moon bases, moon unit alpha and moon unit zappa :cry:
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.
User avatar
llivv
 
Posts: 5642
Joined: 2007-02-14 18:10
Location: cold storage


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable