This sample code shows how to use the user's local date to do calculations.
In this specific example, the local date is used to calculated an age from a field containing the Birth date.
Make sure to match the Field code of your fields, with the Field code written in the code.
Note that the age is only calculated when a record is saved.
Refer to the Tutorial page, on how to add scripts to your app.