Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Setting time, wi-fi
Setting time, wi-fi
Hi all. I run Wheezy on a laptop with wi-fi. I notice there is always a difference between the time shown by my cell phone (12:40 pm now) and that shown by my system clock (12:55 pm now). When I boot my laptop, I'm not connected to the internet yet; I only get connected to the wi-fi network by the Gnome Network Manager after I log into my user account, so it's impossible for my system to get the right time during boot (I think tzdata is the package responsible for this). Any way I can set up automatic time correction after boot and log-in?
Thanks a lot in advance.
Thanks a lot in advance.
Re: Setting time, wi-fi
Are you saying that the time never gets corrected? I think you need the ntpdate package.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
Re: Setting time, wi-fi
Post not relevant because it was asked for a solution for wheezy. The following post works only since jessie (due to systemd).
Please run:
and check if 'NTP enabled' is set to yes. If not, uncomment the servers in vim /etc/systemd/timesyncd.conf and run the following commands:
Please run:
Code: Select all
timedatectl
Code: Select all
systemctl enable systemd-timesyncd.service && systemctl start systemd-timesyncd.service
Last edited by cronoik on 2017-08-14 12:55, edited 1 time in total.
Have a nice day!
Re: Setting time, wi-fi
Hi guys
I did the following (I don't know if I did it right):
I installed ntpdate
Then I edited the file /etc/default/ntpdate:
I removed the ' yes ' on line 6
Now I think I can expect the time to be automatically updated each time I reconnect to the wireless (or cable internet) surface. Am I right?
I did the following (I don't know if I did it right):
I installed ntpdate
Then I edited the file /etc/default/ntpdate:
Code: Select all
# The settings in this file are used by the program ntpdate-debian, but not
# by the upstream program ntpdate.
# Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
# so you only have to keep it in one place.
NTPDATE_USE_NTP_CONF=yes
# List of NTP servers to use (Separate multiple servers with spaces.)
# Not used if NTPDATE_USE_NTP_CONF is yes.
NTPSERVERS="0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org"
# Additional options to pass to ntpdate
NTPOPTIONS=""
Now I think I can expect the time to be automatically updated each time I reconnect to the wireless (or cable internet) surface. Am I right?
Re: Setting time, wi-fi
You didn't need to edit the file. Open Gnome Settings > Date & Time. It's all there.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
- stevepusser
- Posts: 12930
- Joined: 2009-10-06 05:53
- Has thanked: 41 times
- Been thanked: 71 times
Re: Setting time, wi-fi
It's a Wheezy system...advice for systemd is very unlikely to be of help.cronoik wrote:Please run:and check if 'NTP enabled' is set to yes. If not, uncomment the servers in vim /etc/systemd/timesyncd.conf and run the following commands:Code: Select all
timedatectl
Code: Select all
systemctl enable systemd-timesyncd.service && systemctl start systemd-timesyncd.service
MX Linux packager and developer
Re: Setting time, wi-fi
A pretty cheap version would be to use rdate and put this in cron
Code: Select all
@reboot sleep 120 && rdate some.ntp.server.netrdate -nca 0.se.pool.ntp.org
Bullseye amd64, AMD Ryzen 5 3600
Buster amd64, Intel Xeon E3-1240 v3
Sid ppc, PowerPC 7447a
Sid ppc64, PowerPC 970FX
Buster amd64, Intel Xeon E3-1240 v3
Sid ppc, PowerPC 7447a
Sid ppc64, PowerPC 970FX
Re: Setting time, wi-fi
It seems to be working! Thanks a lot, guys! I think we can mark this thread as solved.
Re: Setting time, wi-fi
Given the various solutions provided, could you tell us what you did to make it work. Just so others reading this may benefit.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
Re: Setting time, wi-fi
With pleasure. I only did what I said in my post above: I installed ntpdate, and then I edited /etc/default/ntpdate. And that was all!phenest wrote:Given the various solutions provided, could you tell us what you did to make it work. Just so others reading this may benefit.
cronoik suggested that I run
Code: Select all
timedatectl
phenest suggested I run Gnome Settings, but I don't have Gnome either, or KDE, I prefer the much lighter and faster LXDE. I use some Gnome and KDE packages, but not the whole system.
There is often more than one solution to a Linux problem, and not everybody likes to edit system files, but I do what works for me.
It was a pleasure to interact with you guys, have a nice day!
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Setting time, wi-fi
Debian 7 wheezy does not have that command , there apparrentlty is a package in wheezy backports, but it is more of a systemd thing, I don't have it either,..but I am running Debian 7,.... in the later versions, like 7.11 it might be useable,
https://manpages.debian.org/jessie/syst ... .1.en.html
I wouldn't want to put that on my Debian Wheezy,...but it's your system.
---------- edited---------
I just noticed :
https://manpages.debian.org/jessie/syst ... .1.en.html
I wouldn't want to put that on my Debian Wheezy,...but it's your system.
Code: Select all
garry@debian:~$ timedatectl
bash: timedatectl: command not found
garry@debian:~$ man timedatectl
No manual entry for timedatectl
.garry@debian:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.0 (wheezy)
Release: 7.0
Codename: wheezy
#I just use the 'date' command to set my time, etc.
garry@debian:~$ date
Thu May 4 11:01:31 CDT 2017
garry@debian:~$ man date
I just noticed :
I did not notice at first, but I see Steve all ready pointed this out.http://forums.debian.net/viewtopic.php? ... 04#p642814Postby stevepusser » 2017-04-29 15:37>
It's a Wheezy system...advice for systemd is very unlikely to be of help.
"What we expect you have already Done"
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
Re: Setting time, wi-fi
Sorry. I saw you were using Gnome Network Manager and assumed.luiznetto wrote:phenest suggested I run Gnome Settings, but I don't have Gnome
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
Re: Setting time, wi-fi
Does anyone know if there is a Linux command that shows exactly what the BIOS clock shows without having to look at the BIOS? hwclock won't do this for me; besides the fact that it can only be run by root, it gives almost the same output as the date command:
I was pretty sure there was a command that did just that that I used a long time ago, but now I can't remember. I've been googling in vain. Can anybody help me?
Code: Select all
root@debian-luiz-computer:/home/luiz# hwclock -r
Wed 10 May 2017 11:52:19 AM PDT -0.625363 seconds
root@debian-luiz-computer:/home/luiz# hwclock --show
Wed 10 May 2017 11:52:29 AM PDT -0.062860 seconds
root@debian-luiz-computer:/home/luiz# su luiz
luiz@debian-luiz-computer:~$ date
Wed May 10 11:52:39 PDT 2017
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Setting time, wi-fi
Really ?I've been googling in vain.
Linux command that shows exactly what the BIOS clock shows
First hit:
http://www.thegeekstuff.com/2013/08/hwc ... ce=tuicool
1. Display Hardware Clock Date and Time
Just type hwclock, which will display the date and time of your system’s hardware clock. This is the same date and time that you’ll see from the BIOS screen. You can also use option -r, or –show to display the date and time.
"What we expect you have already Done"
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 5 times
- Been thanked: 16 times
Re: Setting time, wi-fi
You're wrong, sir, the commands hwclock, hwclock -r, hwclock -- show and date all give the same output:
Code: Select all
root@debian-luiz-computer:/home/luiz# hwclock
Wed 10 May 2017 12:43:22 PM PDT -0.297209 seconds
root@debian-luiz-computer:/home/luiz# su luiz
luiz@debian-luiz-computer:~$ date
Wed May 10 12:43:46 PDT 2017
Re: Setting time, wi-fi
This is a little bit confusing, isn't it? I know that my hardware clock shows something different from the time where I am now (San Francisco), and it probably shows utc, but what if there was a difference between what my hardware clock shows and utc? What if my hardware clock was set by someone to the time in Paris or Moscow? The man pages for both date and hwclock are not very clear. I wish they stated clearly, this command shows what is in your BIOS clock. Period. Nothing more than that.
Re: Setting time, wi-fi
Here is the man page for hwclock:
The time shown is always in local
time, even if you keep your Hardware Clock in Coordinated Universal Time
Code: Select all
NAME
hwclock - query or set the hardware clock (RTC)
SYNOPSIS
hwclock [function] [option...]
DESCRIPTION
hwclock is a tool for accessing the Hardware Clock. You can display the current time, set the Hardware
Clock to a specified time, set the Hardware Clock from the System Time, or set the System Time from the
Hardware Clock.
You can also run hwclock periodically to add or subtract time from the Hardware Clock to compensate for
systematic drift (where the clock consistently loses or gains time at a certain rate when left to run).
FUNCTIONS
You need exactly one of the following options to tell hwclock what function to perform:
-r, --show
Read the Hardware Clock and print the time on standard output. The time shown is always in local
time, even if you keep your Hardware Clock in Coordinated Universal Time. See the --utc option.
Showing the Hardware Clock time is the default when no function is specified.
time, even if you keep your Hardware Clock in Coordinated Universal Time
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Setting time, wi-fi
The instructions are not confusing here,: http://www.thegeekstuff.com/2013/08/hwc ... ce=tuicool
and it says very clearly :
This is the same date and time that you’ll see from the BIOS screen.
But if they are not, the same tutorial goes on to explain setting it properly.
The OP just needs to read it.
Not really, it is pretty clear in the tutorial.
and it says very clearly :
This is the same date and time that you’ll see from the BIOS screen.
from : http://www.thegeekstuff.com/2013/08/hwc ... ce=tuicool
This is the same date and time that you’ll see from the BIOS screen.
It does also go on to say:1. Display Hardware Clock Date and Time
Just type hwclock, which will display the date and time of your system’s hardware clock. This is the same date and time that you’ll see from the BIOS screen. You can also use option -r, or –show to display the date and time.
So yes, they might be the same, in fact they should be.Note: The output of the date command might be same as the output of the hwclock command (actually it should be the same). But, the date command gets the date and time from the clock managed from Linux kernel. This in example, there is around 10 mins difference between them.
But if they are not, the same tutorial goes on to explain setting it properly.
The OP just needs to read it.
Postby luiznetto » 2017-05-10 13:13
This is a little bit confusing, isn't it?
Not really, it is pretty clear in the tutorial.
This is correct, read the :Re: Setting time, wi-fi
Postby Dai_trying » 2017-05-10 12:57
If you have your hardware clock set to UTC you can just date -u
Code: Select all
man date
$ man date
DATE(1) General Commands Manual
-----snip--------------------
-u Display or set the date in UTC (Coordinated Universal) time.
This is why the hardware should be set to UTC, you don't seem to be sure of this, and then proceed to throw in all kinds of "What if " things,...that is what is making it confusing, Why are you doing that ?Postby luiznetto » 2017-05-10 13:13
This is a little bit confusing, isn't it? I know that my hardware clock shows something different from the time where I am now (San Francisco), and it probably shows utc, but what if there was a difference between what my hardware clock shows and utc? What if my hardware clock was set by someone to the time in Paris or Moscow? The man pages for both date and hwclock are not very clear. I wish they stated clearly, this command shows what is in your BIOS clock. Period. Nothing more than that.
Well simply set it to UTC. Stop making something confusing, when it really is simple.What if my hardware clock was set by someone to the time in Paris or Moscow?