Get AI summaries of any video or article — Sign up free
How To Use Notion Formulas | Ep.3: Formatting And Build A Timesheet thumbnail

How To Use Notion Formulas | Ep.3: Formatting And Build A Timesheet

Red Gregory·
5 min read

Based on Red Gregory's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

formatDate(now(), …) can extract weekday, month (numeric/abbreviated/full), year (two-digit or four-digit), and time (12-hour or 24-hour) using token casing and repetition.

Briefing

Notion formulas can turn raw date/time fields into practical outputs—like readable timestamps, “in season” product filters, and an automatically calculated Monday–Friday timesheet with pay. The core workflow is consistent: pull a date/time value (often with the now() function), format it into the exact text or number shape needed, then combine date arithmetic (dateAdd/dateSubtract/dateBetween) with conditional logic (if, mod) to derive hours, minutes, and money.

For formatting, the transcript walks through Notion’s formatDate syntax. Using formatDate(now(), …), it’s possible to extract the weekday, month, day suffixes (like st/nd), year (two-digit or four-digit), and time in either 12-hour (with a/p) or 24-hour (military) styles. The key detail is that formatDate can output both text and numeric values depending on the tokens used—so a weekday can become a number (e.g., Sunday starting at 0), while a full month name can be returned as text. Time formatting uses tokens like h and m for hour and minutes, plus a for am/pm; timezone output can be added with z (e.g., EDT vs a more detailed form). For quarters, q plus an optional o token yields values like “4th quarter.”

The episode then addresses timestamps and their limits. Notion’s timestampNow() only reaches minutes, not seconds or milliseconds, so a longer-form timestamp can be generated via formatDate(now(), x) (and a shorter variant with X). For numeric conversions, the transcript notes using t (lowercase) and enclosing it in a number wrapper so the formula returns a number rather than text.

Two practical use cases show how these pieces fit together. First, an “in season produce” database uses the month() function to tick a boolean per month. A formula like “if month(now()) equals 8 (September) then true else false” is copied across months, and a database view filters to items where the relevant month’s checkbox is true—so the view automatically updates as the calendar changes.

Second, a timesheet example builds from date arithmetic. dateSubtract and dateAdd handle offsets like “two days ago,” “two weeks from now,” or “two months from now,” with careful attention to whether the source includes time. For date ranges, dateBetween calculates days between an end date and a start date, while mod is used to extract leftover hours and minutes (e.g., hours = mod(totalHours, 24) and minutes = mod(totalMinutes, 60)). Finally, the timesheet sums clock-in/clock-out durations across Monday through Friday, converts minutes to hours by dividing by 60, and multiplies by an hourly rate to compute weekly pay automatically per row.

Cornell Notes

Notion formulas can reshape date/time data into useful outputs by combining formatDate with date math and conditional logic. formatDate(now(), …) supports extracting weekday, month, day suffixes, year, time (12-hour or 24-hour), timezone, and quarter using specific tokens. For offsets and ranges, dateSubtract and dateAdd shift dates while dateBetween measures elapsed time; mod helps break elapsed time into hours and minutes. These tools power two examples: an “in season” produce filter driven by month(now()) and a Monday–Friday timesheet that sums minutes across days, converts to hours, and multiplies by an hourly rate to estimate weekly earnings.

How does formatDate(now(), …) turn a timestamp into a weekday, month, and year in different forms?

The transcript uses formatDate(now(), 'dddd')-style token patterns. For weekday: lowercase d repeated changes output—one d yields a numeric weekday with Sunday starting at 0, while four d yields the full weekday name. For month: m variants return numeric month (with a +1 adjustment if needed), abbreviated month, or full month name; adding lowercase o after m appends day/month-style suffixes (like st/nd). For year: year(now()) returns a four-digit year, while formatDate(now(), 'yy')-style patterns can return two-digit text. The same approach works for day suffixes by adding lowercase o in the format string.

Why does dateSubtract behave differently when subtracting from now() versus a date property?

now() includes time, so dateSubtract(now(), 2, 'days') carries the time component through the calculation. To display only the date portion, the transcript wraps the result with formatDate(…, '…') tokens that omit time. When subtracting from a date property that doesn’t include time (e.g., a shipped date stored as a date-only field), the output naturally lands on whole dates like “September 29th” without needing extra formatting to strip time.

What’s the limitation with timestampNow(), and what’s the workaround?

timestampNow() only goes up to minutes, not seconds or milliseconds. To get a longer timestamp, the transcript uses formatDate(now(), 'x') for a long-form timestamp (and 'X' for a shorter variant). When a numeric value is needed, it wraps the result with a numeric conversion using t (lowercase) inside the formula so the output becomes a number rather than text.

How does the “in season produce” database automatically update based on the current month?

Each produce item has month-specific boolean properties. A formula checks month(now()) against a target month number; if it matches, the property becomes true, otherwise false. The transcript copies the same one-line condition across months (January through December) and then uses a database view filter that shows only items where the relevant month’s formula property is ticked true. As the calendar month changes, the view updates without manual edits.

How are hours and minutes extracted from a date range for a timesheet?

The transcript uses dateBetween(endDate, startDate, 'days') to get the day component, then uses mod to compute leftover time. For hours, it applies mod 24 to the total hours portion (so a range of 1 day and 16 hours becomes 16 hours remaining). For minutes, it uses mod 60 to extract the minute remainder. It then combines days/hours/minutes with arithmetic and string formatting to produce accurate durations like “0 days and 6 hours” for same-day ranges.

How does the Monday–Friday timesheet compute weekly pay from clock-in/out times?

For each weekday, the formula calculates the elapsed time between the end and start timestamps (including minutes). It sums those minute totals across Monday through Friday, converts minutes to hours by dividing by 60, then multiplies by prop hourly rate to compute weekly earnings. Because the calculation is formula-based, adding a new row automatically populates the weekly total and pay estimate.

Review Questions

  1. Which formatDate tokens (and casing) would you use to output time in 24-hour format versus 12-hour format with am/pm?
  2. How would you adjust a dateSubtract result to display only the date when the source includes time?
  3. What role does mod play when converting a date range into hours and minutes for a timesheet?

Key Points

  1. 1

    formatDate(now(), …) can extract weekday, month (numeric/abbreviated/full), year (two-digit or four-digit), and time (12-hour or 24-hour) using token casing and repetition.

  2. 2

    Timezone output can be added via z tokens, and quarter can be derived with q (plus an optional o token for ordinal-style output).

  3. 3

    timestampNow() is limited to minutes; formatDate(now(), x) (or X) provides a longer timestamp alternative.

  4. 4

    dateSubtract and dateAdd preserve time when starting from now(), so date-only display requires formatting or a date-only source property.

  5. 5

    dateBetween measures elapsed time across a range, while mod is used to split elapsed time into remaining hours and minutes.

  6. 6

    A practical timesheet sums minutes across Monday–Friday, converts to hours, and multiplies by an hourly rate to estimate weekly pay automatically.

  7. 7

    An “in season” database can be driven by month(now()) with copied boolean formulas per month and a view filter for the active month.

Highlights

formatDate(now(), …) supports both numeric and text outputs—weekday can be a number (Sunday=0) or a full name, and months can be numeric, abbreviated, or fully spelled out.
timestampNow() tops out at minutes, so seconds/milliseconds require formatDate(now(), x) instead.
A reliable time-range breakdown uses dateBetween for the day component and mod (24 for hours, 60 for minutes) to compute the leftover time.

Topics