When you dust off an old computer after years in storage and power it on, everything might boot up surprisingly well—except one thing: the date and time are completely wrong. This happens because the small coin-cell battery on the motherboard, known as the CMOS battery (usually CR2032 3V cell), has run out of power. Without it, the system loses its hardware-stored time settings and often resets to a default like January 1, 2008, or some other ancient date.
You don’t have a watch, smartphone, or any other device to check the real time. The only tool at your disposal is the computer’s command-line interface—whether it’s Command Prompt on Windows, Terminal on Linux (or even DOS if it’s really ancient), and luckily, the machine is connected to the internet. How do you quickly find out the actual current date and time using just commands?
The trick relies on a simple fact: almost every web server on the internet includes a Date header in its HTTP responses. This header shows the server’s current time in Greenwich Mean Time (GMT/UTC), formatted according to internet standards. By sending a basic request to any reliable website and looking at that header, you can see the real-world time.
Why This Method Works So Well
HTTP servers are required to send accurate time in the Date header (per web standards). Major sites keep their clocks synchronized, so the time is usually reliable within a second or two. You don’t need special software—just tools like curl (common on modern Windows 10/11, Linux, macOS). Even on older systems, you might find these or similar utilities. For complete documentation of Curl command, you can check its online manual at https://curl.se/docs/manpage.html.
This approach beats waiting for full NTP synchronization (which might not be installed) and works purely through basic web requests.
On Windows (Command Prompt or PowerShell)
Most Windows versions since Vista include curl by default (or you can use it via Git Bash or similar if added).
- Open Command Prompt.
- Run this command:
curl -Is x.com | findstr "Date"
Here -I asks for headers only (HEAD request). -s makes it silent (no progress bar). x.com is a short, reliable domain (formerly Twitter) that always responds quickly. You can use any other reliable domain like Google.com as well.
Example output might look like: Date: Tue, 03 Mar 2026 14:35:22 GMT
That’s the current UTC time! Note the day of the week, date, month, year, hour:minute:second, and GMT.
On Linux (Using Terminal)
Linux almost always has curl or wget installed.
- Open your terminal.
- Use the following command:
curl -Is x.com | grep "Date"
Sample result might look like: Date: Wed, 04 Mar 2026 14:35:22 GMT
Conclusion
Booting up an old computer and finding the clock reset is a classic hardware moment, but the internet comes to the rescue. With one simple curl command, you pull accurate time straight from a web server’s header—no apps, no extra tools, just the command line and a connection. This method is fast, lightweight, and has worked reliably for years across operating systems.
Next time your CMOS battery dies, you’ll know exactly how to check the real date and time in seconds. It’s a handy trick that proves even ancient machines can stay in sync with the modern world using nothing more than basic networking commands.