Insert Timestamp is a lightweight VS Code extension that quickly inserts the current date and time at the cursor. It works in any editor, including Jupyter Notebook (.ipynb) cells, making it perfect for logging, note-taking, and documenting edits.
- Insert the current timestamp in
YYYY-MM-DD HH:mm:ssformat. - Works in all editors, including
.pyfiles and Jupyter Notebook cells. - Assign a custom keyboard shortcut for fast insertion.
- Configure the timezone via extension settings (e.g.,
UTC,UTC+8,local).
Default shortcut:
Ctrl+Shift+T
- Place your cursor where you want the timestamp.
- Press the shortcut — a timestamp like this will appear:
2025-09-08 20:45:12
⚠️ On Linux,Ctrl+Alt+Topens the terminal by default, so a different shortcut is recommended.
- Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(Mac). - Search for
Insert Timestamp. - Press
Enterto insert the timestamp at the cursor.
Here’s a refined version of your Installation section reflecting that users can install directly from VS Code, with a fallback to the Marketplace if needed:
- Open VS Code.
- Go to the Extensions view (
Ctrl+Shift+XorCmd+Shift+X). - Search for Insert Timestamp.
- Click Install.
If you cannot access the Marketplace due to network restrictions, you can download the extension manually from the VS Code Marketplace.
- Download the
.vsixfile from the Marketplace page. - Install it using the command:
code --install-extension insert-timestamp-0.0.1.vsixThis ensures you can use the extension even if direct installation in VS Code isn’t accessible.
-
Change the keyboard shortcut via File → Preferences → Keyboard Shortcuts.
-
Configure the timezone in VS Code Settings:
- Open Settings → Extensions → Insert Timestamp → Timezone.
- Enter a value such as
UTC,UTC+8,UTC-5, orlocal.
The timestamp will automatically adjust according to your selected timezone.
Feel free to fork the repository and submit PRs. Suggestions for new formats, automatic logging, or other enhancements are welcome!
MIT License © ZelinYang21