A support lead asks for a list of opportunities with no activity for more than 30 days. The answer is a date formula in Salesforce that compares the Last Activity Date with TODAY(). Salesforce date formula functions are the built-in functions (TODAY, NOW, DATE, DATEVALUE, ADDMONTHS, WEEKDAY and others) that create, convert, compare and calculate dates and times in formula fields, validation rules, flows and reports.
In this tutorial, I will explain every date function you can use in a formula, show the syntax and a working example for each, and then cover the questions people actually search for: date arithmetic, formatting a date as text, the time zone gotcha, business days, age and end-of-month calculations.
