How to format a Date

When working with dates in most cases including our CMS and most 3rd party REST APIs, you will be getting date in format of "ISO 8601" which looks like this: 2024-06-11T10:59:36. 

With Divhunt you are able to natively format dates with use of a function date. And providing it with desired format.

At this moment, this function is very limited, it provides you only options for showing Day, Month and a Year. If you need more advanced settings, you are able to use Moment.js plugin to format your dates.

On the screenshot below, you can see that we used function "date(D M, Y)" , and this will return us a format of "10 January, 2024". 

  • D stands for a Day (number)
  • M stands for a Month (string)
  • Y stands for a year (number)
  • You are able to use charachters in between, in my case I used comma (,) after a month name.
Variable editor in Divhunt with get('date') and date('D M, Y') functions, preview showing 10 January, 2024