When using a template to create a file, it’s using the values which was correct at the time when it inserted the template. It’s by default not dynamically updated later on.
You insert the template, and it’s done. It’s a static insert.
One execption to this rule when using Templater is that you can use <%+ tp.file.last_modified_date %>, which will update when you switch to reading view. However, this will then not be accessible for queries from. (Or to be more precise: it’ll carry over the template it seems and list the modification time of that file instead… ) Another caveat with this approach, is that caching will affect when it’s updated.
As also discussed in the other thread, it’s a possibility to move these fields out of the frontmatter, and try using dataview queries. This will work to some extent, and they’ll update more often than the Templater counter part. But then again, they’re also prone for cache issues. However, they’re most likely your best bet to get to show these dates.
So maybe something like the following would suit your needs:
This creates a file stats callout, by default collapsed, but that could be changed to opened by changing the first line to > [!info]+ File stats. This now shows the created and last modified date in a locale time format with the addition of the hour, minute and seconds. Feel free to adjust time formats according to personal preferences.
This will update every now and then when dataview feels for refreshing the query. It does require for inline queries to be enabled in the dataview settings.
I’m so fascinated by the amount of plugins written for any “random” cause. Too bad some of them are not updated after the first initial changes, which I reckon is fine for some of the plugins, and not so good for others.
Don’t see why this shouldn’t work still, though. So if it does work, it’s a much better option than using either Templater or dataview which do have the issues mentioned related to caching/refreshing.
This plugin will also cause “static” information to be held in the frontmatter, and as such the updated fields will be available for queries, if that would be wanted at a later stage.