This thread is very old, but in case anyone still wants to know how to do this:
I have 2 ways of doing this without relying on community plugins:
A) More static via template:
Steps:
- Create template with following content:
Modified: {{date:YYMMDD}} {{time:HH:mm}}
- Use “Insert template” to insert the current datetime in note
B) Totaly dynamic, reading the filesystem’s datetimes:
Use:
FS Created: `$= dv.el('span', dv.current().file.ctime.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS))`
FS Modified: `$= dv.el('span', dv.current().file.mtime.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS))`
This can be pasted into the note directly or via template.
Obviously, you can use your preferred date format.
I’m partial to YYMMDD, because it seems most logical and can be comfortably used to sort and compare.
The first method I use to insert creation date in all my notes, because Obsidian uses the filesystem’s created date, which is wildly unreliable, because it reflects when the file has been created on this particular file system and this changes in all kinds of manner through syncs or just copying the vault to new directory and/or device.
Hope this still helps somebody
Cheers