Answers.Body: <p>I don't see any either, but the code to use in such an extension (as either a token or even a smarty modifier) seems pretty straightforward:</p>
  
  <p><a href="https://github.com/civicrm/civicrm-core/blob/5.19.2/CRM/Contact/BAO/Contact.php#L2677-L2684" rel="noreferrer">https://github.com/civicrm/civicrm-core/blob/5.19.2/CRM/Contact/BAO/Contact.php#L2677-L2684</a></p>
  
  <pre><code>      if ($contact-&gt;birth_date) {
          $birthDate = CRM_Utils_Date::customFormat($contact-&gt;birth_date, '%Y%m%d');
          if ($birthDate &lt; date('Ymd')) {
            $age = CRM_Utils_Date::calculateAge($birthDate);
            $values['age']['y'] = CRM_Utils_Array::value('years', $age);
            $values['age']['m'] = CRM_Utils_Array::value('months', $age);
          }
        }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-22T01:18:46.027Z
Answers.LastActivityDate: 2019-11-22T01:18:46.027Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>This sounded like a useful feature, so I added Age tokens to Eileen's <a href="https://civicrm.org/extensions/nzcofuzioncivitoken" rel="nofollow noreferrer">CiviTokens</a> extension, which seems to be the most widely used extension of its kind. Until a new release comes out, you'll have to pull from the <a href="https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken" rel="nofollow noreferrer">master branch of the git repo</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-22T15:38:19.047Z
Answers.Text: Amazing. Thank you. Pulling shortly.
Answers.UserDisplayName: Justin Moore
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-06T04:35:57.840Z
Answers.LastActivityDate: 2019-12-07T17:38:17.503Z
Answers.LastEditDate: 2019-12-07T17:38:17.503Z
Answers.UserDisplayName: Noah Miller
Body: <p>Age is displayed on a contact record but only DOB is a token available in message templates. </p>
  
  <p>Are there any extensions that make age available for use? I've not been able to locate anything.</p>
  
Tags: <contacts><tokens><message-templates>
Title: Do any token extensions provide a token for "age" rather than just DOB?
ThreadText: # Do any token extensions provide a token for "age" rather than just DOB?
  
  (Asked by: username_0 on 2019-11-21)
  
  Age is displayed on a contact record but only DOB is a token available in message templates.
  
  Are there any extensions that make age available for use? I've not been able to locate anything.
  
  **Tags:** contacts, tokens, message-templates
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-12-06. Score: 5 | Accepted answer
  
  This sounded like a useful feature, so I added Age tokens to Eileen's [CiviTokens](https://civicrm.org/extensions/nzcofuzioncivitoken) extension, which seems to be the most widely used extension of its kind. Until a new release comes out, you'll have to pull from the [master branch of the git repo](https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken).
  
  > **Comments:**
  > **username_0**: Amazing. Thank you. Pulling shortly.  
  
  ---
  
  ### Answer by username_1 on 2019-11-22. Score: 5
  
  I don't see any either, but the code to use in such an extension (as either a token or even a smarty modifier) seems pretty straightforward:
  
  <https://github.com/civicrm/civicrm-core/blob/5.19.2/CRM/Contact/BAO/Contact.php#L2677-L2684>
  
  ```
        if ($contact->birth_date) {
          $birthDate = CRM_Utils_Date::customFormat($contact->birth_date, '%Y%m%d');
          if ($birthDate < date('Ymd')) {
            $age = CRM_Utils_Date::calculateAge($birthDate);
            $values['age']['y'] = CRM_Utils_Array::value('years', $age);
            $values['age']['m'] = CRM_Utils_Array::value('months', $age);
          }
        }
  
  ```
  
  
  ---
  
  