Use cases for Calculated Fields and Datediff function:

More information about all the parameters and options of DateDiff  function is available at

1. How to subtract two dates to calculate date difference, like the age of a person?

With Caspio Calculated Fields, you can find the difference between two dates and calculate for example the age of a person to year, month or day granularity.

The function Datediff(year, [@field:DOB], GetUTCDate() is used to calculate age. To use this function to calculate at month and day granularity:



2. How to determine the number of years between two dates?

Use Calculated Fields and Datediff function to determine the number of years between two dates. Here are some examples:

Number of years between two dates:


Number of months between two dates:


Number of days between two dates:


3. How to calculate date difference such as days between when a record was submitted and now?


DateLogged should be replaced with the name of your field where record submission dates are stamped.

To adjust the current date and time to your time zone see the example below which adjusts the time to Pacific which is 8 hours behind UTC.