Learn how to use the formatDate function in Notion formulas.
formatDate(date, string [must conform to Moment format])
It accepts two arguments in the following order:
formatDate(now(), "MMMM DD YYYY") // Output: June 24 2022
formatDate(now(), "dddd, MMMM DD, YYYY hh:mm A zz")
// Output: Friday, June 24, 2022 10:45 AM MDT
You can also use brackets (
) to escape any characters that you’d like to render explicitly (i.e. not use a Moment formatting commands):
formatDate(now(), "[Month of] MMMM, YYYY") // Output: Month of June, 2022
formatDate()uses Moment.js to do date formatting. By specifying the formatting options you want within the function’s second argument, you can customize your date format.
Refer to the Moment.js documentation so see all possible formatting options:
// ERROR: Type mismatch formatDate(now(), "MMMM DD YYYY") is not a Date.
dateAdd(formatDate(now(),"MMMM DD YYYY"),4,"months")
It is also very difficult to perform date comparisons using the output of
formatDate(). While equality comparisons work well:
formatDate(now(), "MMM DD YYYY") == formatDate(prop("Date"), "MMM DD YYYY")
...it is much more difficult to perform "earlier than" or "later than" comparisons.
This example database shows the numbered week of year that matches the date in the Date property.
formatDate()uses Moment.js for date formatting.
formatDate(prop("Date"), "dddd, MMMM Do, YYYY, HH:mm A, wo [week of the year]")
My name is Thomas Frank, and I'm a Notion-certified writer, YouTuber, and template creator. I've been using Notion since 2018 to organize my personal life and to run my business and YouTube channel. In addition to this formula reference, I've created a free Notion course for beginners and several productivity-focused Notion templates. If you'd like to connect, follow me on Twitter.