In Obsidian, you can insert timestamps in various ways depending on your needs, especially with plugins like Dataview and Tasks. Below are several methods to insert timestamps, including manual methods, shortcuts, and plugin-based approaches.
1. Manually Insert a Timestamp
If you just want to insert a timestamp without automation, you can type it manually in a format that suits your needs. For example:
2023-10-05 14:30
[[2023-10-05]] 14:30 (if you want to link to a daily note)
Obsidian recognizes ISO 8601 date formats (YYYY-MM-DD) and can link them to daily notes if you use the [[ ]] syntax.
2. Use Obsidian's Core Templates Plugin
Obsidian has a built-in Templates plugin that can help you insert timestamps dynamically. Here's how to set it up:
Steps:
-
Enable the Templates Plugin:
- Go to
Settings > Core Plugins and ensure the "Templates" plugin is enabled.
-
Set a Templates Folder:
- Go to
Settings > Templates and specify a folder where your templates will be stored (e.g., Templates).
-
Create a Timestamp Template:
-
Insert the Template:
- In any note, use the command palette (
Ctrl/Cmd + P) and type "Insert template."
- Select your timestamp template, and it will insert the current date and time.
3. Use the "Insert Current Date/Time" Command
Obsidian has built-in commands to insert the current date or time without needing a template.
Steps:
- Open the command palette (
Ctrl/Cmd + P).
- Search for and select one of the following commands:
Insert current date: Inserts the date in your preferred format (configurable in settings).
Insert current time: Inserts the time in your preferred format.
Insert current date and time: Inserts both.
Customize Date/Time Format:
- Go to
Settings > Daily Notes to set your preferred date format (e.g., YYYY-MM-DD).
- The time format can also be customized in some plugins or via community plugins (see below).
4. Use the Tasks Plugin for Timestamps
If you're using the Tasks plugin, you can add timestamps to tasks to track creation, completion, or due dates. The plugin supports date and time metadata in tasks.
Example:
-
Add a task with a timestamp:
- [ ] Finish report 📅 2023-10-05 ⏰ 14:30
Here, 📅 is used for the due date, and ⏰ is used for the time (optional).
-
To automatically add a creation timestamp to tasks, you can use the Tasks plugin's settings to enable automatic timestamping when tasks are created or completed.
Steps to Enable Automatic Timestamps in Tasks:
- Go to
Settings > Community Plugins > Tasks.
- Look for options like "Add creation date to new tasks" or "Add completion date to completed tasks."
- Enable these options to automatically append timestamps to tasks.
5. Use the Dataview Plugin for Dynamic Timestamps
If you're using the Dataview plugin, you can create dynamic queries or scripts to display or insert timestamps. For example, you can use Dataview to show the current date/time or metadata about files (e.g., creation or modification time).
Example: Display Current Date/Time in a Note
Add the following Dataview JavaScript (DQL) code block to your note:
dv.paragraph(new Date().toISOString());
This will display the current timestamp in ISO 8601 format (e.g., 2023-10-05T14:30:00.000Z).
Example: Display File Creation/Modification Time
To display the creation or modification time of the current note:
TABLE file.ctime AS "Created", file.mtime AS "Modified"
FROM ""
WHERE file.path = this.file.path
6. Use a Community Plugin for Advanced Timestamp Features
If the above methods don't meet your needs, you can install a community plugin for more advanced timestamp functionality. Here are some useful plugins:
QuickAdd Plugin
The QuickAdd plugin allows you to create custom commands to insert timestamps or other dynamic content.
Steps:
- Install the QuickAdd plugin via
Settings > Community Plugins > Browse.
- Enable the plugin.
- Go to
Settings > QuickAdd and create a new "Capture" or "Template" action.
- Use JavaScript to insert a timestamp. For example, add this script to insert the current timestamp:
const date = new Date();
const timestamp = date.toLocaleString(); // Or use date.toISOString() for ISO format
app.fileManager.processFrontMatter(app.workspace.getActiveFile(), (fm) => {
fm['timestamp'] = timestamp;
});
- Bind the action to a hotkey or access it via the command palette.
Natural Language Dates Plugin
This plugin allows you to insert dates and times using natural language (e.g., "today at 3pm"). It can also insert timestamps in your preferred format.
Steps:
- Install the Natural Language Dates plugin via
Settings > Community Plugins > Browse.
- Enable the plugin.
- Use the command palette (
Ctrl/Cmd + P) and search for "Insert timestamp" or "Insert date."
- Configure the plugin's settings to customize the timestamp format.
7. Use Hotkeys for Faster Timestamp Insertion
If you frequently insert timestamps, you can create a hotkey to speed up the process.
Steps:
- Go to
Settings > Hotkeys.
- Search for commands like "Insert current date," "Insert current time," or plugin-specific commands (e.g., from QuickAdd or Natural Language Dates).
- Assign a hotkey (e.g.,
Ctrl/Cmd + T) to the command.
8. Automate Timestamps with Daily Notes
If you use Obsidian's Daily Notes feature, you can automatically include timestamps in your daily notes using templates.
Steps:
- Go to
Settings > Daily Notes and specify a template for your daily notes.
- In the template, include a timestamp using the Templates plugin syntax (e.g.,
{{date}} {{time}}).
- Each new daily note will automatically include the current timestamp.
Summary of Options
| Method | Best For | Requirements |
|---|
| Manual Entry | One-off timestamps | None |
| Templates Plugin | Repeated timestamp insertion | Core Templates plugin |
| Insert Date/Time Commands | Quick insertion | None |
| Tasks Plugin | Task-related timestamps | Tasks plugin |
| Dataview Plugin | Dynamic timestamp displays | Dataview plugin |
| QuickAdd Plugin | Custom automation | QuickAdd plugin |
| Natural Language Dates | Natural language timestamp insertion | Natural Language Dates plugin |
| Hotkeys | Speeding up insertion | None |
| Daily Notes | Automatic timestamps in daily notes | Core Daily Notes plugin |
Final Tips
- Choose the method that best fits your workflow. For example, if you need automation, use plugins like QuickAdd or Templates. If you need dynamic displays, use Dataview.
- If you're comfortable with JavaScript, you can create custom scripts using the Obsidian API or plugins like Templater for even more advanced timestamp functionality.
- Always test new plugins or scripts in a vault backup to avoid unintended changes.
Let me know if you need further assistance!