How to extract the day of the month as a number from title (YYYY-MM-DD)

What I’m trying to do

I am trying to get the day of the month as a number, based on the title of the daily note (YYYY-MM-DD).

Things I have tried

<%moment(tp.file.title).format("dd")%>  

But that returns a two letter string of the day of the week, not the day of the month as a number.

Within Templater you’ll need to do: <% moment(tp.file.title).format("DD")%>, see format reference. This format is used by Daily notes and Templater (and moment in general), but do note that Dataview uses Luxon tokens.

1 Like

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