Change note creation date so I can sort it by date properly

Things I have tried

I tried to search for the plugin but couldn’t find.

What I’m trying to do

I would like to edit the note creation date so that I can sort the notes by dates created. I want to import some old journal entries manually which I have created in the past so I want to set them to that specific date.

Changing the actual creation date of a file is at best a little hairy, so I wouldn’t even try going down that path. However, a much better alternative would be to add the creation date in the front matter, and then use that for queries later on.

Depending on your matter of import, how you would do that differs, but in the end I’d you should end up with something like the following at the very top of your file:

---
CreatedDate: 2022-11-23
---

Which would allow for queries like:

```dataview
LIST
SORT CreatedDate
```

Thanks for reply

Do i need some plugin to do this?

Yes, you would need the Dataview plugin for those queries.

1 Like

Thanks and can I ask how do I go about sorting by the creation date after editing the front matter as you mentioned above? Also do I have to do this front matter on every note to run and sort by the query?

My sample query would indeed sort by the CreatedDate in the frontmatter. And yes, it would need to be in every file.

Theoretically, you could possibly also do a call where if it’s not present, you’d default to the actual creation date of the file, but that’s another story.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.