# Tracking when a note was created and last edited

**URL:** <https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059>\
**Category:** Help\
**Created:** [September 26, 2022, 10:41pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059 "2022-09-26T22:41:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 26, 2022, 10:41pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/1 "2022-09-26T22:41:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mnvwvnm](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnvwvnm/32/9766_2.png) [@mnvwvnm](https://forum.obsidian.md/u/mnvwvnm)\
**Post date:** [September 26, 2022, 11:04pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/2 "2022-09-26T23:04:14Z")

</div>

To start you need to understand what’s the yaml frontmatter: [YAML front matter - Obsidian Help](https://help.obsidian.md/Advanced+topics/YAML+front+matter)  
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.

---

<div class="post-metadata">

**Author:** ![CawlinTeffid](https://forum.obsidian.md/user_avatar/forum.obsidian.md/cawlinteffid/32/82899_2.png) [@CawlinTeffid](https://forum.obsidian.md/u/CawlinTeffid)\
**Post date:** [September 26, 2022, 11:05pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/3 "2022-09-26T23:05:29Z")

</div>

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?).

---

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 26, 2022, 11:10pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/4 "2022-09-26T23:10:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mnvwvnm](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnvwvnm/32/9766_2.png) [@mnvwvnm](https://forum.obsidian.md/u/mnvwvnm)\
**Post date:** [September 26, 2022, 11:20pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/5 "2022-09-26T23:20:19Z")

</div>

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

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

```

(This format is useful to other plugins like Dataview)

---

<div class="post-metadata">

**Author:** ![egauthier](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/e/ce73a5/32.png) [@egauthier](https://forum.obsidian.md/u/egauthier)\
**Post date:** [September 26, 2022, 11:42pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/6 "2022-09-26T23:42:27Z")

</div>

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:

```auto
<%+ 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).

````auto
```dataview
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
```

````

---

<div class="post-metadata">

**Author:** ![mnvwvnm](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnvwvnm/32/9766_2.png) [@mnvwvnm](https://forum.obsidian.md/u/mnvwvnm)\
**Post date:** [September 26, 2022, 11:49pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/7 "2022-09-26T23:49:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![I-d-as](https://forum.obsidian.md/user_avatar/forum.obsidian.md/i-d-as/32/59965_2.png) [@I-d-as](https://forum.obsidian.md/u/I-d-as)\
**Post date:** [September 27, 2022, 12:36am UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/8 "2022-09-27T00:36:55Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 27, 2022, 4:13am UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/9 "2022-09-27T04:13:43Z")

</div>

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 (?))

---

<div class="post-metadata">

**Author:** ![egauthier](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/e/ce73a5/32.png) [@egauthier](https://forum.obsidian.md/u/egauthier)\
**Post date:** [September 27, 2022, 5:05am UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/10 "2022-09-27T05:05:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![egauthier](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/e/ce73a5/32.png) [@egauthier](https://forum.obsidian.md/u/egauthier)\
**Post date:** [September 27, 2022, 1:38pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/11 "2022-09-27T13:38:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 27, 2022, 1:55pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/12 "2022-09-27T13:55:35Z")

</div>

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](https://github.com/platers/obsidian-linter/blob/master/docs/rules.md#yaml-timestamp), and it doesn’t have anything to do with templates afaik

---

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 27, 2022, 2:00pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/13 "2022-09-27T14:00:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![richardOracleDba](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@richardOracleDba](https://forum.obsidian.md/u/richardOracleDba)\
**Post date:** [September 27, 2022, 2:59pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/14 "2022-09-27T14:59:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 27, 2022, 9:34pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/15 "2022-09-27T21:34:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 30, 2022, 12:04pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/16 "2022-09-30T12:04:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![richardOracleDba](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@richardOracleDba](https://forum.obsidian.md/u/richardOracleDba)\
**Post date:** [September 30, 2022, 1:52pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/17 "2022-09-30T13:52:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 30, 2022, 2:13pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/18 "2022-09-30T14:13:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![linck5](https://forum.obsidian.md/user_avatar/forum.obsidian.md/linck5/32/34909_2.png) [@linck5](https://forum.obsidian.md/u/linck5)\
**Post date:** [September 30, 2022, 2:42pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/19 "2022-09-30T14:42:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CawlinTeffid](https://forum.obsidian.md/user_avatar/forum.obsidian.md/cawlinteffid/32/82899_2.png) [@CawlinTeffid](https://forum.obsidian.md/u/CawlinTeffid)\
**Post date:** [September 30, 2022, 7:44pm UTC](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059/20 "2022-09-30T19:44:26Z")

</div>

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.

[Next page](https://forum.obsidian.md/t/tracking-when-a-note-was-created-and-last-edited/44059.md?page=2)
