Start a conversation

Convert date formats

If you're using date fields, then the date format will always be dd-mm-yyyy. You can use calculations to change this format by getting the day (dd), month (mm), and year (yyyy). In this article examples are shown that you can use in your calculation templates. We'll use the date 30 January 2025 as an example throughout the article.

ddmmyyyy

For example, if you enter the value 30-01-2025 (30 January 2025) in a date field, this calculation template will convert that to 30012025.

var date = "{your_date_variable}";
var day = date.substr(0,2);
var month = date.substr(3,2);
var year = date.substr(6,4);
day + "" + month + "" + year;

mm/dd/yyyy

var date = "{your_date_variable}";
var day = date.substr(0,2);
var month = date.substr(3,2);
var year = date.substr(6,4);
month + "/" + year + "/" + year;
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Castor Support Team

  2. Posted
  3. Updated