<p>The Twig extension package is not included with your Craft install. So you need to <a href="https://github.com/twigphp/Twig-extensions" rel="nofollow">download</a> it and add it to your Craft plugin manually.</p>

CC BY-SA 3.0
2015-02-18T12:12:53.307Z
2015-02-18T12:12:53.307Z
carlcs
<p>Is it possible to activate the following Twig extension from within a craft plugin:</p>

<p><a href="http://twig.sensiolabs.org/doc/extensions/date.html" rel="nofollow">http://twig.sensiolabs.org/doc/extensions/date.html</a></p>

CC BY-SA 3.0
2015-02-18T12:16:18.730Z
If the `time_diff` filter is all you need, then maybe it's worth looking into this Craft plugin with similar functionality: ["Time Ago In Words"](https://github.com/blue-mantis/BM-Time-Ago-In-Words).
carlcs
CC BY-SA 3.0
2015-02-18T12:22:11.570Z
How did I miss that?! Perfect, I will need to extend functionality a tad as I also need to return the actual difference values in years, months and days too.
Sam Hibberd
<templating><plugins>
How do you add a core twig extension in plugins using addTwigExtension()?
# How do you add a core twig extension in plugins using addTwigExtension()?

(Asked by: username_0 on 2015-02-18)

Is it possible to activate the following Twig extension from within a craft plugin:

<http://twig.sensiolabs.org/doc/extensions/date.html>

**Tags:** templating, plugins

> **Comments:**
> **username_1**: If the `time_diff` filter is all you need, then maybe it's worth looking into this Craft plugin with similar functionality: ["Time Ago In Words"](https://github.com/blue-mantis/BM-Time-Ago-In-Words).  
> **username_0**: How did I miss that?! Perfect, I will need to extend functionality a tad as I also need to return the actual difference values in years, months and days too.  

---

## 1 answers

### Answer by username_1 on 2015-02-18. Score: 1

The Twig extension package is not included with your Craft install. So you need to [download](https://github.com/twigphp/Twig-extensions) it and add it to your Craft plugin manually.


---

