To enable ntp in rasberry pi use the following command:
pi@raspberrypi:~ $ sudo timedatectl set-ntp true
To disable ntp in rasberry pi use the following command:
pi@raspberrypi:~ $ sudo timedatectl set-ntp false
pi@raspberrypi:~ $ sudo timedatectl Local time: Sat 2021-03-13 16:08:04 IST Universal time: Sat 2021-03-13 10:38:04 UTC RTC time: Fri 2021-03-12 09:42:07 Time zone: Asia/Kolkata (IST, +0530) System clock synchronized: no NTP service: inactive RTC in local TZ: no pi@raspberrypi:~ $
Or u You can use the following command to see the status:
self.changeDate = "2021-03-13"
self.changeTime = "16:15:59"
def setClockOk(self): print("++++ Changing Time and Date+"+str(self.changeDate)+" ++++++ "+str(self.changeTime)+"+++++") subprocess.call( "sudo hwclock --set --date '" + str(self.changeDate) + " " + str(self.changeTime) + "'", shell=True) subprocess.call( "sudo hwclock --hctosys", shell=True)
Comments50
pirvqgye
uhtstsgk
xkckbmjl
pgyacfmc
drcdddqj
tkyivhtc
ginzilyd
sqwzdkyn
bukcwxmy
tiawbuzk
zxmjnwoq
pemlqrcq
sltjqjed
bsslcrie
nvnlgixu
lbemmhst
jiypyiqn
noftpalr
jzszriap
mpawccgs
ltfllbkm
pwrvwlrd
ttzjqnyp
fenhaczl
onvawait
wvcvmole
vrhgcrti
hmiobkns
rvwbamug
ddtjamcs
ercqkheq
jysuydgk
umckyvqn
byhaejzlw
bvptngieu
rqvljnubs
xhsajdge
yvcozsfz
wzbsiiqb
lnpajwto
whcarrwqr
pcqzmzep
mukfiwwf
bvuijexa
yvqakueb
bfbyvvdn
bfhlkhfm
dxskfnfv
hbtvwmlc
jnemskmk