Issue trying to use function from DateTimeHelper class: "timeAgoInWords() is not defined" Not quite sure how to use functions defined in Helper classes in my templates. For example, trying to use "timeAgoInWords" on an entry's dateCreated attribute. I get an internal server error and a "Unknown "timeAgoInWords" function" message when I try to visit the page. It occurs to me that perhaps I have to include or import the DateTimeHelper class? I'm not sure how to go about this.

Here's a link to the Craft docs on the package that I'm trying to include:

https://craftcms.com/classreference/helpers/DateTimeHelper

I'm trying to include the timeAgoInWords function in my index.html template within the templates folder.

Thanks a bunch!
Generally speaking, only Variable classes are exposed to templates in Craft and there isn't a Variable wrapper for DateTimeHelper.

However, that would be a super-simple plugin to write that exposes timeAgoInWords as a Twig filter so you could do something like

entry.postDate|timeAgoInWords