What I’m trying to do
I’m trying to create a simple template, with the following line:
[[ <% tp.date.now(“YYYY-MM-DD”) %> ]]
But receive the following error:
file cannot contain the following characters: * / < > " : ? \
Now I assume that it is probably a setting that I misconfigured or missed.
But I’m unable to find which setting it is.
Things I have tried
I disabled the core plugin of templates and daily notes
I installed dataview and periodic notes
I tried playing with the code but nothing helped.
Sorry if it is a duplicate I was unable to find a similar post
Pch
July 14, 2025, 9:41am
2
How do you apply the Templater’s template ?
Because what you wrote first need to be read and parse by Templater (so it can replace the tp.date.now() by a date) before clicking on the “link”…
1 Like
Here, I am running this command:
Note top, template bottom.
1 Like
This worked!
But now I have a different line failing when doing this hotkey.
[[<% tp.date.now("DD-MMMM-YYYY", "-1d", tp.file.title, "DD-MMMM-YYYY") %>]]
it prompts :
Templater Error: Invalid reference date format, try specifying one with the argument ‘reference_format’
Pch
July 14, 2025, 1:05pm
5
This is probably because the note’s title in which you apply/run the template doesn’t follow the format ("DD-MMMM-YYYY") you’ve “said” tp.file.title follows ? …
Although, I think the "-1d" could, potentially, also play a role …
I think, the offset argument in tp.date.now() can only take a number (representing a number of days to add or subtract) or an ISO8601 duration string (iirc )
So, you might want to try this (to get “yesterday” based on the note’s title):
[[<% tp.date.now("DD-MMMM-YYYY", -1, tp.file.title, "DD-MMMM-YYYY") %>]]
… after making sure the template is applied on a note titled following the DD-MMMM-YYYY format .
2 Likes
system
Closed
August 11, 2025, 1:05pm
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.