timestamp
Learn how to use the timestamp function in Notion formulas.
The timestamp() function converts a date argument into its corresponding Unix timestamp (also known as Unix Time or Epoch Time), which is a number.
1
timestamp(date)
The Unix timestamp is the number of seconds since January 1, 1970 at 00:00 UTC.
Notionโ€™s timestamp() function specifically outputs a millisecond timestamp.
You can use this site to convert human-readable dates to Unix timestamps, or vice-versa:
Epoch Converter
epochconverter
Good to know: Since Notion returns a millisecond timestamp, pasting the timestamp for very early dates (e.g. January 8, 1970) can cause conversion tools like the website above to return an incorrect date.
To account for this, remove the final three zeroes (000) from Notionโ€™s timestamp before pasting into a conversion tool.
Learn more about Unix time:
What Is the Unix Epoch, and How Does Unix Time Work?
How-To Geek

1
timestamp(now()) // Output: 1656012120000 (will change with the value of now()

The example database below uses the timestamp() function to determine which of two dates is the later one.

timestamp
College Info Geek on Notion

1
// Compressed
2
if(timestamp(prop("Date 1")) == timestamp(prop("Date 2")),"Date 1 and Date 2 are the same.",if(timestamp(prop("Date 1")) > timestamp(prop("Date 2")),"Date 1 is later than Date 2.","Date 2 is later than Date 1."))
3
โ€‹
4
// Expanded
5
if(
6
timestamp(
7
prop("Date 1")
8
) == timestamp(
9
prop("Date 2")
10
),
11
"Date 1 and Date 2 are the same.",
12
if(
13
timestamp(
14
prop("Date 1")
15
) > timestamp(
16
prop("Date 2")
17
),
18
"Date 1 is later than Date 2.",
19
"Date 2 is later than Date 1."
20
)
21
)
This formula uses a nested if-statement to first check if the timestamp values of the two dates are equal. If they are, the formula returns, "Date 1 and Date 2 are the same."
If not, the next block checks to see if Date 1's timestamp is larger than Date 2's timestamp.
Depending on the result of this comparison, the formula will return, "Date 1 is later than Date 2," or "Date 2 is later than Date 1."

โ€‹
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 20d ago
Copy link
On this page
Example Formula
Example Database
View and Duplicate Database
"Later Date" Property Formula