Template Date and Time not Updating using tp.file.last_mofied_date and warning popping up next to tp.file.creation_date

Warning asking me to change property type with template??

I set up a template using templater and I put this at the top of my template:

Created: <% tp.file.creation_date(“MMMM Do, YYYY [at] h:mma”) %>

Modified: <% tp.file.last_modified_date(“MMMM Do, YYYY [at] h:mma”) %>


But I am getting a warning saying that some of the data is incompatible with the property key. I tried changing the property type to date & time thinking that may be the issue but I am still getting the warning. Any ideas? Also, the date and time are not updating when edited on the last_modified property.

I think it’s because of your [at] in principle I should leave you without that, I have it in my properties:

created: <% tp.file.creation_date("YYYY/MM/DD HH:mm:ss") %>

and it leaves me perfectly.
The second issue is the code with the last update date. Currently, there are 2 problems with templater and YAML or properties:
It does not allow adding certain codes to properties.
and it does not allow adding self-updating codes from the template, that is:
if you add a template that has:

update: <% tp.file.last_modified_date("YYYY/MM/DD HH:mm:ss") %>

Yes, it will leave you, and the date will appear, but that will appear, the date not the code, and therefore it will not be updated later because it is flat data.
It will never leave you:

update: <%+ tp.file.last_modified_date("YYYY/MM/DD HH:mm:ss") %>

that “+” is what it does not allow.
It also does not allow a template to have

<%+ tp.file.last_modified_date("YYYY/MM/DD HH:mm:ss") %>

anywhere in the note,if you add the code manually, it will let you add it, and it will update itself but you cannot add it in properties.
and for that I think this other code is better:

`=dateformat(this.file.mtime, "yyyy/MM/dd - HH:mm:ss")`

It will give you the last update date and allows you to add it from the template, but it is not valid for properties. although it updates itself and can be included in a template
since the other one has to be added manually later to obtain the same result.

1 Like

This might help,
someone in the Discord community helped me with this error.

1 Like

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