Custom variable formatted as date

Hello,
I’m making a template and I want to have a “happensDate” attribute for each page and I want to be able to work with it as with publishedDate, Date and unpublishedDate - basically what I need is formatting.
Is it somehow possible?
Thanks a lot,
Greenscreener

I just found out you can use https://gohugo.io/functions/dateformat/.