Just the current month and year

What I’m trying to do

I want to display just the current month and year (without the day), but in all the documentation and forum topics, I cannot seem to successfully get the current date and month without any errors.

Things I have tried

I tried the following templater syntax:

N/A - *see below

  • I haven’t tried anything as I am not sure what I would try. Documentation states I can do, “date now/today”, “date yesterday”, “date tomorrow”, “date weekday”, "next Moday/Tues/Wednesday etc., but absolutely nothing that refers to pulling just the month and the year.

What documentation are you looking at?

There are a bunch of examples on this page: tp.date - Templater

// Date now with format
<% tp.date.now("Do MMMM YYYY") %>

So if you want the month and year, delete the Do:

<% tp.date.now("MMMM YYYY") %>

And all the specific date format letters are here: Moment.js | Docs

MMM = Jan Feb ... Nov Dec
MM = 01 02 ... 11 12
Mo = 1st 2nd ... 11th 12th
etc.

You would use the symbols you want, in the order you want. If you want 2024-08 then it would be:

<% tp.date.now("YYYY-MM") %>
1 Like

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