How to set or change a computer's date and time

Updated: 02/04/2024 by Computer Hope
Virtual clock

This page contains steps on changing the computer's date and time via the operating system or in the BIOS (Basic Input/Output System) settings. It also describes how to change the date and time on mobile devices.

Note

If the date and time is resetting to an old date or the wrong time, the CMOS battery is bad and needs to be replaced. For help with CMOS battery issues, see: Why is computer asking for the time and date each time it boots?

Tip

If you are using Windows on a virtual machine, change the date and time on the host machine, not the virtual machine. The virtual machine gets the current date and time information from the host.

Setting the date and time in BIOS or CMOS setup

  1. Open the CMOS setup.
  1. In the system setup menu, locate the date and time.
  2. Using the arrow keys, navigate to the date or time, adjust them to your liking, and press the appropriate keyboard key to Save and Exit the BIOS.
Note

Steps may vary for your BIOS. For additional information, see: Computer BIOS help and support.

Note

If, after rebooting the computer the date and time need to be set again, your CMOS battery is likely bad. Consider replacing the CMOS battery to fix the problem. See: How to replace the CMOS battery.

Setting date and time in the operating system

To change the system time in your operating system, follow the steps below.

Windows 10 and Windows 11

Note

Windows 10 and Windows 11 automatically adjust the date and time for you and only let you adjust the time if you disable the automated feature. If the wrong date and time are set, or you must change the time or time zone, follow the steps below.

  1. Right-click or tap the date and time in the Windows Notification Area in the bottom-right corner of the screen.
  2. Select Adjust date/time from the pop-up menu.

Adjust date and time selector in Windows.

  1. If you want the time set automatically, ensure the toggle switch for the Set time automatically option is in the On Windows 11 toggle switch in the On position. position and your Time zone is correct.
  2. To manually adjust the time, click the toggle switch under Set time automatically option so that it's in the Off Windows 11 toggle switch in the Off position. position, then click the Change button.

Changing the date and time in Windows.

  1. In the window, adjust the date or time as desired, and click the Change button.

Changing the date and time in Windows.

By default, only hours and minutes are displayed in the Windows Notification Area on the taskbar. In Windows 10, there is no ability to add seconds to the time displayed. However, if you click the date and time, a pop-up window opens and displays the time with seconds included.

In Windows 11, to show seconds for the time displayed on the taskbar, follow the steps below.

  1. In the Windows search box on the taskbar, type settings and press Enter.
  2. In the left navigation menu, click Personalization.
  3. In the main section of the Settings window, scroll down and click the Taskbar option.
  4. Scroll down the list and click the Taskbar behaviors option.
  5. Scroll down to near the bottom of the taskbar behaviors list and check the box for the Show seconds in system tray clock setting.

Windows 8

  1. Click or tap the date and time in the Windows Notification Area in the bottom-right corner of the screen.
  2. Select Change date and time settings at the bottom of the window (shown below).

Time and Date in Windows 8

  1. In the Date and Time window, under the Date and Time tab, click the Change date and time button.
  2. Make your adjustments and click OK.
  3. Click OK on the main Date and Time window to save the changes.
Tip

There is no ability to add seconds to the time displayed in the Windows Notification Area on the Taskbar. However, if you click the date and time, a pop-up window opens and displays the time with seconds included.

To change the time zone, follow these steps.

  1. In the Date and Time window from above, under the Date and Time tab, click the Change time zone button.
  2. Select the new time zone in the Time zone drop-down field and click OK.
  3. Click OK on the main Date and Time window to save the time zone change.

Windows 7 and Vista

In Windows 7 and Windows Vista, follow these steps to adjust the date and time.

  1. Press the keyboard shortcut Windows key+D or navigate to the Windows desktop.
  2. Click or tap the date and time in the Windows Notification Area in the bottom-right corner of the screen.
  3. Select Change date and time settings at the bottom of the window (shown below).

Time and Date in Vista and 7

  1. In the Date and Time window, under the Date and Time tab, click the Change date and time button.
  2. Make your adjustments and click OK.
  3. Click OK on the Date and Time window to save the changes.
Tip

There is no ability to add seconds to the time displayed in the Windows Notification Area on the Taskbar. However, if you click the date and time, a pop-up window opens and displays the time with seconds included.

To change the time zone, follow these steps.

  1. In the Date and Time window from above, under the Date and Time tab, click the Change time zone button.
  2. Select the new time zone in the Time zone drop-down field and click OK.
  3. Click OK on the main Date and Time window to save the time zone change.

Windows XP, 2000, 98, 95, NT, and NT 4

In Windows XP and earlier versions, follow these steps to set the date and time.

  1. Navigate to the Windows desktop.
  2. Right-click the time in your Systray, usually located at the bottom-right of your screen.
  3. Click the Adjust Date/Time menu item.
  4. This action opens the Date/Time Properties window, where you can adjust the date, time, and time zone.
  5. Once the proper date and time are set, click Apply, and then OK.
Tip

You may also double-click the time to open the Date/Time Properties window.

Tip

To change how the computer handles daylight savings, click the Time Zone tab and check or uncheck the Automatically adjust clock for daylight saving changes option.

date command

MS-DOS and Windows command line

Setting the date through MS-DOS or the Windows command line is accomplished by using the date command. See our date command page for further information.

Setting the time through MS-DOS or the Windows command line is accomplished by using the time command. See our time command page for further information.

Linux command line

In Linux, use the date command to manually set the system date and time.

date -s "8 MAY 2020 11:36:00"

Or, to synchronize your system clock with a network time server, use ntpdate. For example, on Ubuntu or Debian:

sudo apt update && sudo apt install ntpdate

Specify a network time server to the ntpdate command, for example us.pool.ntp.org.

sudo ntpdate us.pool.ntp.org
9 May 15:32:31 ntpdate[11562]: adjust time server 107.21.100.177 offset -0.004751 sec

To keep your system time synchronized regularly, install the ntp system service.

sudo apt install ntp

The service starts immediately, and starts automatically at system boot. To configure the service, edit the file /etc/ntp.conf, then restart the service.

sudo nano /etc/ntp.conf
sudo systemctl restart ntp

To access the hardware clock directly, use the hwclock command.

sudo hwclock --show

FreeBSD

In FreeBSD, ntp can be installed with the pkg package manager.

sudo pkg install ntp

Setting the date and time on the Apple operating system

  1. At the top-left corner of the desktop screen, click the Apple icon.
  2. Select System Settings from the Apple menu.

System Settings selector in macOS.

  1. In the sidebar, scroll down and click the General selector. Then, in the section to the right, click Date & Time.

Date and Time selector in macOS.

  1. From here, you have a few options. To set the time automatically, click the Set button in the Source section and choose a source. Then, click Time zone to choose your area (if not using your current location).

Setting the time and date automatically in macOS.

  1. To set the time manually, click the toggle switch next to Set time and date automatically so that it's in the off position. Then, click the Set button next to Date and time.

Setting the time and date manually in macOS.

  1. In the window, click the arrow boxes next to the date and time to adjust them. When you're satisfied with your choices, click the Set button.

Setting the time and date manually in macOS.