date()

The date() function is a shorthand method of instantiating a new Date Object. It also allows you to use dates within Output tags e.g.


    {{ date() }} // 19 Mar 2024
    
    {{ date('tomorrow') }} // 20 Mar 2024
    
    {{ date().year }} // 2024
    
    {{ date().time }} // 09:17

This in turn means that the date object can be instantiated for limited use from within an editable region in the CMS.

The arguments accepted for the date() function are the same as those for the Date Object's construct.