Hi,
This is a "hail Mary" type of reply. What do you get if you just use Informat( MyDateStr ) or equivalently,
Parse Date( MyDateStr ).
Also, in the book Using JMP chapter The Column Info Window it states that "Locale Date Varies based on local OS setting." And the JSL Syntax Reference shows
Format( x, "Currency", "EUR", 20, <<Use Locale(0)); // ignores computer locale
InFormat() and Parse Date() show a 3rd argument <<Use Locale(0).
So my "hail mary suggestions are:
- use Informat( MyDateStr ) alone
- use Informat( MyDateStr, "m/d/y h:m:s", << Use Locale(0) );
- create a column from the string
See the script. It shows the power of Informat() even propery converting 30/12/.... But conversion in place (at least our previous methods) no longer worked. I hope you find something that works.
//------#6: Create a data table with a Character column of different date time formats
dtimeList={};
InsertInto( dtimeList, "JUN162010 2:59:13");
InsertInto( dtimeList, Format(AsDate(Today()), "yyyy-mm-ddThh:mm:ss"));
InsertInto( dtimeList,Format(AsDate(Today() - 3*34*60), "yyyy-mm-ddThh:mm"));
InsertInto( dtimeList,Format(AsDate(Today() + 12*34*60), "yyyy-mm-ddThh:mm"));
InsertInto( dtimeList, "12/01/2010");
InsertInto( dtimeList, "01/12/2010");
InsertInto( dtimeList, "30/12/2010 1:1:1");
test3_dt = New Table ("Test Datetime", new Column("dummy", character));
test3_dt << add rows( nitems(dtimelist));
test3_dt:dummy << set values (dtimeList);
//----run to here---------------------------------------------------------
//----Look at the data table...create a new column using Parse Date function
convCol = test3_dt << New Column( "Parsed dummy", Numeric, Continuous );
convCol << set each value (Informat(:dummy) );
convCol << Format("monddyyyy h:m:s");
wait(2);
convCol << Format("m/d/y h:m:s");
//---The code below worked in JMP 8 and 9 and 10 and maybe 11. It does not work in JMP 12, 13, 14
//Also, even though the column has mixed formats, by converting to numeric,
//continuous and specifying a datetime format, JMP automatically parses the dates
//:dummy << {data type( "Numeric"), Modeling Type("Continuous") };
//:dummy << Format("m/d/y h:m:s" );