Hi All,
Help with this would be greatly appreciated. I am trying to create a new column that generates the elapsed time in hours from a column that has date/time in the following format, "04/22/2025 11:16 AM."
Thanks!
Barbara
Found a solution that works!
Could you post your solution? If you have your data correctly formatted as date in JMP the difference will be in seconds and you can convert it to hours dividing it by 3600 or In Hours(1) or just change the format to Duration this might be unnecessary (generally I would try to keep the values as seconds and play around with formats, but this varies case by case). Below is example in a form of JSL
Names Default To Here(1);
dt = New Table("demo",
Add Rows(4),
Compress File When Saved(1),
New Column("Times",
Numeric,
"Continuous",
Format("ddMonyyyy h:m:s", 22, 0),
Input Format("ddMonyyyy h:m:s", 0),
Set Values([3830699241, 3830702820, 3830710041, 3830882841])
)
);
dt << New Column("Dif", Numeric, Continuous, Format("hr:m:s", 13, 0), Set Property("Units", "hr:m:s"), Formula(
Dif(:Times)
));

</CODE>For more complicated comparisons you can use <A href="https://help.jmp.com/help?keyword=JSL%20Date%20Difference&lang=en&os=win&source=application&version=18.2.0" target="_blank" rel="noopener noreferrer">Date Difference()</A>, in this case it would look something like this (note that the intervalName is "hour" and not "second" in this example)</P>
<PRE><CODE class=" language-jsl">Date Difference(
Lag(:Times),
:Times,
"hour",
"fractional"
);