Start a conversation

Convert a date to CDISC format (dd/mmm/yyyy)

Dates entered into Date fields are stored in the format dd-mm-yyyy. The calculation template below can be used to convert a date field entry into CDISC format (dd/mmm/yyyy). 

For example, if 30-01-2025 is entered into the date field, this calculation will convert the entry into the new format, as 30/JAN/2025. Replace your_date_variable with the variable name of the date field that should be converted.

var date = '{your_date_variable}';
var day = date.substr(0,2);
var month = date.substr(3,2);
var year = date.substr(6,4);
var months = ["JAN", "FEB", "MAR","APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"];
monthInteger = parseInt(month) - 1;
day + "/" + months[monthInteger] + "/" + year;
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Castor Support Team

  2. Posted
  3. Updated