timestamp
Learn how to use the timestamp function in Notion formulas.
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:
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:
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.
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."
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 4mo ago