Calculating the Date N Years Ago
You can calculate the date N years prior to a specified date, assuming that one year is equal to 365 days.
In kintone, values entered in "Date", "Time", and "Date and time" fields are treated as UNIX time. This means that dates and times are treated in seconds, and therefore, you need to use seconds as the unit of time in your formula. For example, enter "60" to indicate one minute. Enter "3600" or "60*60" to indicate one hour, and enter "86400" or "60*60*24" to indicate one day.
-
If you want to calculate the date two years prior to the date entered in a "Date" field
Place a "Calculated" field on the app form and set the following formula.- Formula: Date-(2*365*24*60*60)
- Format: Date (Aug 06, 2012)
Note that this sample formula does not take into account leap years (366 days in a year).