My Jscript imports a CSV file with dates into Sparx EA and stores the dates in a tagged value. The CSV file holds each date in the format “dd/mm/yyyy” e.g. "14/09/2017" = 14th September 2017.
If the day is greater than 12, then the Sparx import stores the date correctly, e.g. "28/09/2017" = 28th September 2017.
If the day is greater than 12, then the API assumes format “dd/mm/yyyy”.
If the day is 12 or less, then the Sparx import stores the date incorrectly. The API assumes the date format is “mm/dd/yyyy”
If the day is 12 or less, then the Excel.Application API converts the first 2 numbers to the month e.g. "11/09/2017" = 9th November 2017 (should be 11th September 2017).
Here is some sample code to demonstrate the process.
// Open CSV file as a worksheet
var xlApp = new ActiveXObject( "Excel.Application");
var xlBook = xlApp.Workbooks.Open (inputFileName);
var xlSheet = xlBook.Worksheets(worksheetNo);
var wsSource = xlSheet
var my11thDateCell = wsSource.Cells(11,

; // CSV Sample "11/09/2017"
var my12thDateCell = wsSource.Cells(12,

; // CSV Sample "12/10/2017"
var my13thDateCell = wsSource.Cells(13,

; // CSV Sample "13/09/2017"
var my14thDateCell = wsSource.Cells(14,

; // CSV Sample "14/09/2017"
// A snippet from the tagged value update function which receives parameter last_Modified_Date
if (foundTag.Name == "08-Last_Modified_On") {
foundTag.Value = last_Modified_Date;
myPTag7Found = true;
foundTag.Update();
I have tried string conversions and parsing, but the problem still persists. Is there a more fundamental way of configuring the Sparx API to read the CSV dates as format “dd/mm/yyyy” ?