Tracking when a note was created and last edited

I went looking for this in the forum and elsewhere and couldn’t find a definite answer:

How can I be sure to track when a note was created, and when it was last edited?

I think this is available in the filesystem metadata of the file (I’m not to sure how that works), but when syncing between devices, is it still going to work? If I create a file in device A, and tomorrow I open obsidian in device B, it will sync and create that file, so will the original metadata be preserved? Can I trust that no matter the OS?

Or is there some way to have those things be tracked in the note body itself?

1 Like

To start you need to understand what’s the yaml frontmatter: YAML front matter - Obsidian Help
Is a place where you can add some metadata to your notes.
Then you can add some data manually or use some plugins to auto-write some data: for example, Template or Templater plugins.

You can a template to add the creation date/time (that is, the time when you trigger the template), and I know I’ve seen screenshots of notes with a last-edited time (maybe there’s a plugin?).

So no filesystem metadata then?

I’m aware of the YAML metadata. But I couldn’t find a way to automatically add the timestamps when I create and edit a note yet. Do you guys have any resources where I can find how to do that?

It depends from the used plugin.
For example, for Templates (a core plugin) you can use something like this:

{{date: YYYY-MM-DD[T]HH:MM}}

(This format is useful to other plugins like Dataview)

1 Like

Be careful with creation date. Many cloud storage providers have different ideas of what acreation date is, and I have finally given up (I use Dropbox which thinks syncing of a new file, the creation date is the sync, not the actual creation on the client) and I use creation date in the YAML, which is effectively hardcoded at the time the Note is created. Then I use Templater to give me dynamic modified date like this:

<%+ tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm:ss") %>

For Dataview lists and tables, I just use Modified date. Here is an example from my Daily Note that shows all files modified in the last 7 days (which implies also created).

TABLE file.frontmatter.topic as "Topic", file.mtime as "Modified",  file.folder as "Path"
WHERE file.mday != this.file.mday AND file.mtime >= (this.file.mtime - dur(7 d))
SORT file.mtime DESC

But for the case (sync, multiple OS, etc.) if creation date isn’t reliable, isn’t the same for the modified date?

The Linter plugin is also capable of modifying YAML timestamp values. You can enable “Lint on save” and also enable “Keep track of the date the file was last edited in the YAML front matter. Gets dates from file metadata.”. You can also adjust the key name. By default they are date created and date modified.

I am definitely not a longtime user of this plugin , but I just installed and tested it, and it works. It was simple enough to adjust the default date/time format in the settings, such as YYYY-MM-DD HH:mm:ss. The only hard part is remembering to press ctrl s.

1 Like

I tried the Liner plugin here. It’s really convenient

Hmm but that means if I created a file in my PC for example, then I go to my phone, it syncs and messes up the created/updated file metadata, when I save the note, the plugin will update the YAML with the messed up values right? (assuming plugins work on a phone (?))

I have found, and purely anecdotal, with no science involved, that the modified date seems to be preserved across file systems, and cloud syncs.

Disclaimer: I don’t use windows, so not sure about that, but across ext4 on linux, APFS, Dropbox and ios, the modified time seems to be preserved well.

Sorry, a lot of variables here, but one for sure is Dropbox’s idea that a creation time is when the file is originally sync’ed, not created on the client is (IMHO) not right. I can’t speak for Google Drive or OneDrive, perhaps they handle it differently.


The YAML is static. It is created when the template runs, not derived from the underlying file system.

Hmm are we talking about the same thing? Linter will update the YAML when it runs, and it derives the timestamps from the file system, and it doesn’t have anything to do with templates afaik

Is there any plugin that can run javascript whenever a file is edited?

There is a plugin called ‘Update time on edit’. I use that, and it puts 2 entries in your front matter, the create and update timestamps for the note your editing.


I’m testing that Plugin. It looks like it does exactly what I was looking for. It’s just weird that it doesn’t update immediately, it takes some time to update the info. It’s a bit finicky how it updates, I haven’t figured out fully how it behaves yet, but seems promising. I’ve confirmed it doesn’t use the file system metadata so no issues there

Yeah the “Update time on edit” is not working for me. It has some bug and weirdness in it. It has added timestamps, most of the time. But there is a note that I have had sitting there for a long time, well over the 1 minute configured in the plugin, and no timestamps to be found

In the settings for the plugin, have you checked that the folder you are using isn’t listed under “folders to exclude”?

Yeah. I haven’t changed it. The default “folders to exclude” is empty

I’m starting to play with syncing files with Google Drive as well. When the the Google drive syncing is activated (just the native Google Drive sync, no external tools), it will keep updating the updated_at date all the time, even if the file contents are not edited

I don’t have obsidian sync yet. I was considering buying it. But I can’t know if I’m gonna have the same issue with obsidian sync, so I don’t know what to do

I’m thinking either I give up using Obsidian, or I give up being able to keep track of recent files, or I try to write a plugin myself

With the core Templates plugin you’d have to trigger the template yourself. The Templater community plugin can be set to run on note creation.