βŒ›

Time And Date Formatting In Notion (Ep.3)

πŸ₯’
In-Season Produce

guide

Part 1

Now Year

formatDate(now(), "Y")
Alternatives
  • formatDate(now(), "YY")

Now

formatDate(now(), "L LT")
Alternatives
  • formatDate(now(), "L") β†’ 10/01/2020
  • formatDate(now(), "LL") β†’ October 1, 2020
  • formatDate(now(), "LLL") β†’ October 1, 2020 9:56 AM
  • formatDate(now(), "LLLL") β†’ Thursday, October 1, 2020 9:56 AM
  • β€”
  • formatDate(now(), "dddd, MMMM Do YYYY")
  • formatDate(now(), "dddd [the] Do [of] MMMM")
Β 

Now Month

formatDate(now(), "MMMM")
Alternative
  • month(now()) β†’ 0(Jan)-11(Dec)
  • formatDate(now(), "M") β†’ 1(Jan)-12(Dec)
  • formatDate(now(), "Mo") β†’ 1st ... 12th
  • formatDate(now(), "MM") β†’ 01 β†’ 12
  • formatDate(now(), "MMM") β†’ Jan ... Dec
  • formatDate(now(), "MMMM") β†’ January ... December
πŸ“’
Go to produce

In-Season?

if(month(now()) == 0 and prop("January"), true, if(month(now()) == 1 and prop("February"), true, if(month(now()) == 2 and prop("March"), true, if(month(now()) == 3 and prop("April"), true, if(month(now()) == 4 and prop("May"), true, if(month(now()) == 5 and prop("June"), true, if(month(now()) == 6 and prop("July"), true, if(month(now()) == 7 and prop("August"), true, if(month(now()) == 8 and prop("September"), true, if(month(now()) == 9 and prop("October"), true, if(month(now()) == 10 and prop("November"), true, if(month(now()) == 11 and prop("December"), true, false))))))))))))

Next Month?

if(month(now()) == 0 and prop("February"), true, if(month(now()) == 1 and prop("March"), true, if(month(now()) == 2 and prop("April"), true, if(month(now()) == 3 and prop("May"), true, if(month(now()) == 4 and prop("June"), true, if(month(now()) == 5 and prop("July"), true, if(month(now()) == 6 and prop("August"), true, if(month(now()) == 7 and prop("September"), true, if(month(now()) == 8 and prop("October"), true, if(month(now()) == 9 and prop("November"), true, if(month(now()) == 10 and prop("December"), true, if(month(now()) == 11 and prop("January"), true, false))))))))))))

Now Date

formatDate(now(), "D")
Alternative
  • formatDate(now(), "Do") β†’ 1st ... 31st
  • formatDate(now(), "DD") β†’ 01 ... 31

Now Weekday

formatDate(now(), "dddd")
Alternative
  • formatDate(now(), "d") β†’ 0(Sunday)-6(Saturday)
  • formatDate(now(), "dd") β†’ Su ... Sa
  • formatDate(now(), "ddd") β†’ Sun ... Sat

Now Time

formatDate(now(), "LT")
Alternative
  • formatDate(now(), "h:mm") β†’ 1:53
  • formatDate(now(), "h:mm a") β†’ 1:53 pm
  • formatDate(now(), "h:mm A") β†’ 1:53 PM
  • formatDate(now(), "H:mm a") β†’ 13:53 pm (military time)
Find just hour
  • hour(now()) β†’ 18
  • hour(now()) % 12 β†’ 6

Quarter

formatDate(now(), "Qo")
Alternative
  • formatDate(now(), "Q") β†’ 1 .. 4

Timestamp

formatDate(now(), "X")
Alternative
  • timestamp(now()) β†’ long-form timestamp
  • toNumber(now()) β†’ Same as above
Part 2

2 Days Ago

formatDate(dateSubtract(now(), 2, "days"), "ll")

2 Weeks From Now

formatDate(dateAdd(now(), 2, "weeks"), "ll")

2 Months From Now

formatDate(dateAdd(now(), 2, "months"), "MMMM")

Arrival Estimate

formatDate(dateAdd(prop("Shipped"), 3, "days"), "ll [between 8am and 4pm]")

Morning?

(hour(prop("Shipped")) <= 11) ? "βœ”οΈβœ”οΈβœ”οΈβœ”οΈβœ”οΈ" : ""
Part 3

Days + Hours

format(dateBetween(end(prop("Date Range")), start(prop("Date Range")), "days")) + "dy " + format(dateBetween(end(prop("Date Range")), start(prop("Date Range")), "hours") % 24) + "hr"

Hours + Minutes

format(dateBetween(end(prop("Date Range")), start(prop("Date Range")), "hours")) + "hr " + format(dateBetween(end(prop("Date Range")), start(prop("Date Range")), "minutes") % 60) + "m "

Days + Hours + Minutes

format(dateBetween(end(prop("Date Range")), start(prop("Date Range")), "days")) + "dy " + format(dateBetween(end(prop("Date Range")), start(prop("Date Range")), "hours") % 24) + "hr " + format(dateBetween(end(prop("Date Range")), start(prop("Date Range")), "minutes") % 60) + "m "
πŸ“’
Go to timesheet

Timesheet

round(100 * (dateBetween(end(prop("Monday")), start(prop("Monday")), "minutes") + dateBetween(end(prop("Tuesday")), start(prop("Tuesday")), "minutes") + dateBetween(end(prop("Wednesday")), start(prop("Wednesday")), "minutes") + dateBetween(end(prop("Thursday")), start(prop("Thursday")), "minutes") + dateBetween(end(prop("Friday")), start(prop("Friday")), "minutes")) / 60 * prop("Hourly Rate")) / 100
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β