How to Set the Date & Time on Raspberry Pi (Desktop & Lite)
In most cases, the Raspberry Pi operating system will set the date and time automatically, and it shouldn’t be an issue. But in some cases, like if you don’t have an Internet connection, it can be an issue. In this post, we’ll learn how to set the date & time on Raspberry Pi.
NTP is enabled by default on Raspberry Pi OS and will connect to an Internet server to set the date and time accordingly. It’s also possible to set the date and time manually, from the desktop interface or with the sudo date -s ‘YYYY-MM-DD HH:MM:SS’ command.
I will now guide you through the details and give you a solution that should help in most cases, whether you’re using a Desktop environment or not, or if your Pi has Internet or not.
If you’re feeling lost in all the Raspberry Pi jargon, I’ve got something to help you out. I’ve created a free glossary that explains all the essential terms and abbreviations in a way that’s easy to understand. It’s a great resource to have by your side. Get your free copy here.
Why Are Date and Time an Issue on Raspberry Pi?
On a computer, you’ll rarely think about setting the date and time correctly. You might configure it after the installation and then forget about it for years. But on Raspberry Pi, you might have an issue, especially when using it without the Internet, or not using a recent Raspberry Pi OS version.
The first reason is that Raspberry Pi OS relies on an Internet connection to get and keep the correct date and time.
On the desktop version, there are no ways to set the date and time directly in the Interface, the only thing you can change is the time zone.
Read next: 7 Surprising Uses for a Raspberry Pi
But the other reason comes from hardware specificity.
On any computer, there is a battery that allows the computer to “remember” the date and time, even when disconnected from a power source for a long time. On Raspberry Pi, there isn’t such a thing.
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!
Download now

On recent Raspberry Pi OS versions (since Stretch I think), a package is included to fix this: “fake-hwclock”. It will store the current date and time in the operating system files, to restore it after a reboot if there is no Internet connection.
If you are using an older Raspberry Pi OS system, or a different operating system, it might be something to look at before going further, as I will not cover this case in the following.
Members get an ad-free version of every guide, plus exclusive project support.
Join the Community | Sign In
Note: If you need a hardware clock, there is a way to add a module (like this one on Amazon) via the GPIO pins. I won’t explain this in detail here, but that’s something to think about for projects where time is important but where the Raspberry Pi is not connected to the Internet.
Setting Date and Time on Raspberry Pi OS Desktop
If you are on Raspberry Pis OS, the date and time configuration should be pretty easy if you have Internet access. But let’s take a look at what you can do to set it correctly.
Use the Welcome Wizard
On the first boot on Raspberry Pi OS, a configuration wizard will show up and ask you for a bunch of information, including your location. Your Pi doesn’t ask for it out of curiosity, but to set the time zone according to your answer.

Once the timezone is set, the operating system will synchronize the date and time with an Internet server, and display the correct clock depending on your location. In most cases, you’ll be done after that. The Raspberry Pi will check regularly with a time provider to keep you in sync.
I have a complete guide on how to set up Raspberry Pi OS here, if you need a more in-depth step-by-step explanation.
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!
Download now
Use the Control Centre
If you miss the welcome wizard or need to change something in Raspberry Pi OS, you can use the built-in configuration tool on your desktop.
In the main menu, go to Preferences > Control Centre.
Under the “Localisation” tab, you can change the current time zone:

Choose the one corresponding to your location, and click on “Ok” twice to save the changes.
A few seconds later, the time should be updated in the top-right corner.
On Raspberry Pi OS Desktop, this is the only control you have directly in the interface. You can set a different time zone, but can’t set the date and time manually. To manage this, you need to use the command line.
So, if these tips didn’t help you, keep reading to find other solutions.
Setting the Date and Time from the Command Line
If you’re using Raspberry Pi OS Lite or are connected via SSH, you don’t have access to these graphical tools. Not to worry, there are similar alternatives while in the command line.
Use raspi-config
The easiest way to fix your time zone is to use raspi-config, to get similar results quickly.
Raspi-config is the main configuration tool available on Raspberry Pi OS Lite, allowing you to configure many things, including date and time:
- Start the tool with this command:
sudo raspi-config
- Got to “Localisation options”, then “Timezone”:

- Pick a geographic area and a specific time zone:


Download the free PDF, keep it open, and stop wasting time on Google.
Download now
Once done, the system configuration will be updated with the new date/time.

By the way, you can use this command to display the current date and time:date
In One Command
So, raspi-config will help us to do the same thing as the Desktop interface, but still can’t manually configure the date and time. The only way to set a custom date is to use the command line.
Here is the command to set the date and time manually:sudo date -s 'DATE'
For example:sudo date -s '2025-10-08 13:04:00'
The date is not required, you can also use:sudo date -s '13:04:00'
It works the same way.
The date command will handle most date formats, but you can find more information on the GNU website here if you have any doubts.
Use the command “date” to check if it changed as expected:date

This command is pretty common on all Linux distributions (link to my favorites), so it should work to set the date and time on other Linux distros even if you’re not using Raspberry Pi OS.
You might also like: Pi5 vs. Pi4: I tested them, here's the result
However, it might not work if your system has time synchronization enabled (NTP). You need to disable it first with:sudo timedatectl set-ntp false
Once disabled, do the previous command again, and it should keep your entry as the current date/time.
Download the free PDF, keep it open, and stop wasting time on Google.
Download now
And to switch back to automatic date, just enable NTP again with:sudo timedatectl set-ntp true

Quick note: If you find it hard to remember all these commands, I’ve put them all on a one-page cheat sheet. You can download it for free here so you have it handy whenever you're working on a project.
NTP and Timedatectl Configuration
By the way, NTP and Timedatectl are the tools you might need to understand if you want to go a bit further on this topic. They are the reason why the time and date synchronization is working with an Internet connection, but not so well without it.
NTP is the protocol used for time synchronization on a network, and timedatectl is the tool installed by default on Raspberry Pi OS to manage it.
For example, even if your Raspberry Pi doesn’t have Internet access, but can access a local network with a time server, you can edit the configuration to synchronize it with your own server instead of a “random” Internet server.
I will not go into more detail about this, but I have a dedicated guide about NTP that you should definitely read if you are interested.
Stuck on this project? Ask me or other Pi users in the RaspberryTips Community. We help each other out and you'll get answers quick. Join and fix it together.
Video Tutorial
If you want to see those tips in action, you can watch this video on my YouTube channel:
You might also like: 15 Easy Projects for Raspberry Pi Beginners
Once your initial system setup done, you are ready to move to the next steps, here are a few suggestions:
- 17 Best Apps to Use a Raspberry Pi as a Desktop PC
- How Can you Make your Raspberry Pi Run Faster? (8 tips)
- Can a Raspberry Pi 4 really Replace your Desktop PC? (I Tried)
Whenever you’re ready, here are other ways I can help you:
Test Your Raspberry Pi Level (Free): Not sure why everything takes so long on your Raspberry Pi? Take this free 3-minute assessment and see what’s causing the problems.
The RaspberryTips Community: Need help or want to discuss your Raspberry Pi projects with others who actually get it? Join the RaspberryTips Community and get access to private forums, exclusive lessons, and direct help.
Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.
Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.
You can also find all my recommendations for tools and hardware on this page.

Yey, finally some one that can explain how to manually set time in rpi in 2021.
It works!