Insert the current date and time in Windows
In Excel, it’s easy to insert the current date and time into a cell. You only have to press Ctrl + ; for the date and Ctrl + Shift + ; for the time. Use the former, the latter, or both for a complete timestamp.
However, are you frustrated that these keyboard shortcuts aren’t available across Windows?
I certainly am, as I often include the date at the start of new file and folder names for explicit sorting. After all, you can’t trust File Explorer’s “Date created” and “Date modified” columns to do this.
Instructions
1
Download AutoHotkey v2.0 from the official website.
2
When the download finishes, select Open.
3
In the installer window, select Install.
4
If prompted by the User Account Control window, select Yes.
5
Select New Script in the AutoHotkey window.
6
Name the file “insert-date-time”.
7
Select Create.
8
Right-click the file and select Edit in Notepad.
9
Copy and paste the following code:
#Requires AutoHotkey v2.0
#SingleInstance Force ; Prevents duplicate instance warning
; Ctrl + ; to insert current date, e.g. 2025-03-23
^;::
{
Send FormatTime(, "yyyy-MM-dd")
}
; Ctrl + Shift + ; to insert current time, e.g. 13-40
^+;::
{
Send FormatTime(, "HH-mm")
}
; Ctrl + Alt + ; to insert current date and time, e.g. 2025-03-23-13-40
^!;::
{
Send FormatTime(, "yyyy-MM-dd-HH-mm")
}
10
Save the file.
11
Double-click the file to run the script.
A green “H” icon will appear in your system tray, indicating the script is active.
Keyboard shortcuts
- Insert current date: Ctrl + ;
- Insert current time: Ctrl + Shift + ;
- Insert current date and time: Ctrl + Alt + ;
How to automatically run the script at startup
1
Press Windows + R.
2
Input “shell:startup” and select OK.
3
Move the insert-date.ahk file to the Startup folder.
Final words
You can always fine-tune the script to suit your desired needs. Go to the documentation to find all the date and time formats.
Why, after almost 40 years of Windows, this isn’t possible without a third-party tool, I do not know, but it’s certainly useful for saving a few precious seconds.
