<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Creating an Time elapsed column from a datetime column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-an-Time-elapsed-column-from-a-datetime-column/m-p/873871#M103780</link>
    <description>&lt;P&gt;Found a solution that works!&lt;/P&gt;</description>
    <pubDate>Thu, 15 May 2025 23:25:23 GMT</pubDate>
    <dc:creator>babn</dc:creator>
    <dc:date>2025-05-15T23:25:23Z</dc:date>
    <item>
      <title>Creating an Time elapsed column from a datetime column</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-an-Time-elapsed-column-from-a-datetime-column/m-p/873861#M103779</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Barbara&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 22:40:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-an-Time-elapsed-column-from-a-datetime-column/m-p/873861#M103779</guid>
      <dc:creator>babn</dc:creator>
      <dc:date>2025-05-15T22:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an Time elapsed column from a datetime column</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-an-Time-elapsed-column-from-a-datetime-column/m-p/873871#M103780</link>
      <description>&lt;P&gt;Found a solution that works!&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 23:25:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-an-Time-elapsed-column-from-a-datetime-column/m-p/873871#M103780</guid>
      <dc:creator>babn</dc:creator>
      <dc:date>2025-05-15T23:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an Time elapsed column from a datetime column</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-an-Time-elapsed-column-from-a-datetime-column/m-p/875237#M103877</link>
      <description>&lt;P&gt;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&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;&amp;lt; New Column("Dif", Numeric, Continuous, Format("hr:m:s", 13, 0), Set Property("Units", "hr:m:s"), Formula(
	Dif(:Times)
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1747844101274.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76065iC0DB0CB1C9C9FA07/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1747844101274.png" alt="jthi_0-1747844101274.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;For more complicated comparisons you can use &lt;A href="https://help.jmp.com/help?keyword=JSL%20Date%20Difference&amp;amp;lang=en&amp;amp;os=win&amp;amp;source=application&amp;amp;version=18.2.0" target="_blank" rel="noopener"&gt;Date Difference()&lt;/A&gt;, in this case it would look something like this (note that the intervalName is "hour" and not "second" in this example)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Date Difference(
	Lag(:Times),
	:Times,
	"hour",
	"fractional"
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 May 2025 16:15:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-an-Time-elapsed-column-from-a-datetime-column/m-p/875237#M103877</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-05-21T16:15:10Z</dc:date>
    </item>
  </channel>
</rss>

