formatDate
Learn how to use the formatDate function in Notion formulas.
1
formatDate(date, string [must conform to Moment format])
It accepts two arguments in the following order:
- 1.A date (can be passed via properties - Date, Created Time, Last Edited Time - or via date functions such as now, fromTimestamp, dateAdd, dateSubtract)
- 2.
1
formatDate(now(), "MMMM DD YYYY") // Output: June 24 2022
2
3
formatDate(now(), "dddd, MMMM DD, YYYY hh:mm A zz")
4
// 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):1
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:
Good to Remember: Notion formulas are picky about data types. The formula editor will almost never do automatic type conversion, so you must pass the correct data types when you use functions.
1
// ERROR: Type mismatch formatDate(now(), "MMMM DD YYYY") is not a Date.
2
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:1
formatDate(now(), "MMM DD YYYY") == formatDate(prop("Date"), "MMM DD YYYY")
...it is much more difficult to perform "earlier than" or "later than" comparisons.
It is also not possible to create date-based filters in a database view using a formula property that outputs a date string via
formatDate()
.For an example, see this recurring tasks tutorial that uses Make.com and the Notion API to parse the output of
formatDate()
:This example database shows the numbered week of year that matches the date in the Date property.
formatDate()
uses Moment.js for date formatting.
1
formatDate(prop("Date"), "wo")
1
formatDate(prop("Date"), "dddd, MMMM Do, YYYY, HH:mm A, wo [week of the year]")
The Detailed Format property demonstrates many of the available formatting options. To see all formatting options, visit the Moment.js reference.
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.

Last modified 4mo ago