Date Time Format Problem
Greetings,
I am having an issue with a date-time format import from a csv file. An example of the original data content is
17/09/08 02:55:16 AM
17/09/14 00:44:41 AM
17/09/30 17:57:06 PM
17/10/07 00:26:32 AM
The format is yy/mm/dd hh:mm:ss AM. The problem is that JMP does not convert the data into proper format. A straight import results in
17/09/2008 02:55:16 AM; which is the wrong date.
I tried to format the column with
Column(dt1, 2) <<Set Name("Date and Time")<<Data type("Numeric")<<Set Modeling Type( Continuous <<Informat( "y/m/d h:m:s" )<<Format("d/m/y h:m:s");
The result is the same à 2008/09/17 02:55:16 AM
A different approach, insert a new column and use a formula
dt1 <<New Column("Date", Numeric, Continuous, Format Date("y/d/m"), Formula( Left("20"||Munger(Loc,6,"20",""), 10)));
The result is a string 2017/09/08; but the output needs to be numeric. Visually, great a step closer.
Since things are bit closer, the next three pieces of code were implemented.
dt1 <<New Column("Date1", Numeric, Continuous, Format Date("y/d/m"), Formula( Informat(Left("20"||Munger(Loc,6,"20",""), 10))));
dt1 <<New Column("Date2", Numeric, Continuous, Format Date("yyyy/dd/mm"), Input Format("yyyy/dd/mm"), Formula( Parse Date(Left("20"||Munger(Loc,6,"20",""), 10))));
dt1 <<New Column("Date3", Numeric, Continuous, Format Date("yyyy/dd/mm"), Input Format("yyyy/dd/mm"), Formula( As Date(Left("20"||Munger(Loc,6,"20",""), 10))));
ResulTs are
Date1 column --> 3587673600
Date2 column --> 3587673600
Date3 column --> .
The Date 1 and Date 2 results are numeric but with the wrong format. How can I get the right format i.e. numeric, continuous, and date format? Thank you for help.