Pinado
Posts: 16
Joined: Mon Jul 15, 2019 8:51 pm
Location: Colorado, USA

Date and Time Change

Tue Aug 06, 2019 7:17 pm

Hello, I am wondering if there is a way to change the date and time on the Pi after it has been set up. My date and time are incorrect and it is hampering my ability to use the Pi effectively.

Thanks!

drgeoff
Posts: 11239
Joined: Wed Jan 25, 2012 6:39 pm

Re: Date and Time Change

Tue Aug 06, 2019 7:28 pm

If your RPi can reach the internet it should be able to get the correct time and date. If the date is correct but the time is off by an integer multiple of 30 minutes it is likely that you have not set the correct timezone.

If the RPi cannot reach the internet you can manually set the time and date using the date command at a command prompt. You will need to do this every time the RPi is powered up.
Quis custodiet ipsos custodes?

User avatar
rpdom
Posts: 17720
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Date and Time Change

Tue Aug 06, 2019 7:31 pm

drgeoff wrote:
Tue Aug 06, 2019 7:28 pm
If the RPi cannot reach the internet you can manually set the time and date using the date command at a command prompt. You will need to do this every time the RPi is powered up.
Or you can buy a cheap RTC (Real Time Clock) module with battery that plugs onto the GPIO pins and gives the Pi the correct time (once it has been set). It will probably drift by a few seconds a month though, so you may need to correct it occasionally.
Unreadable squiggle

Pinado
Posts: 16
Joined: Mon Jul 15, 2019 8:51 pm
Location: Colorado, USA

Re: Date and Time Change

Tue Aug 06, 2019 7:50 pm

Thank you!

deepo
Posts: 614
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Date and Time Change

Tue Aug 06, 2019 8:05 pm

Try this command:

Code: Select all

pi@raspberrypi:~ $ timedatectl
      Local time: Tue 2019-08-06 22:03:51 CEST
  Universal time: Tue 2019-08-06 20:03:51 UTC
        RTC time: n/a
       Time zone: Europe/Copenhagen (CEST, +0200)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no
And this:

Code: Select all

pi@raspberrypi:~ $ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: active (running) since Sat 2019-08-03 23:32:09 CEST; 2 days ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 259 (systemd-timesyn)
   Status: "Synchronized to time server 193.104.228.123:123 (2.debian.pool.ntp.org)."
   CGroup: /system.slice/systemd-timesyncd.service
           └─259 /lib/systemd/systemd-timesyncd

Aug 03 23:32:08 raspberrypi systemd[1]: Starting Network Time Synchronization...
Aug 03 23:32:09 raspberrypi systemd[1]: Started Network Time Synchronization.
Aug 06 21:37:52 raspberrypi systemd-timesyncd[259]: Synchronized to time server 193.104.228.123:123 (2.debian.pool.ntp.org).
/Mogens

Return to “Beginners”