<?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: MM/DD HH:MM conversion how to do in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/789411#M96991</link>
    <description>&lt;P&gt;There are a lot of different methods of converting strings to datetimes in JMP. Building it from ground up by splitting it from parts is the method which has the highest success rate but there can be easier methods, such as Format Pattern (note that In Format() has &amp;lt;&amp;lt; Use Locale argument which you might need sometimes)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

strs = {"20240207_163752", "20240208_132212", "20240320_180945", "20240321_062705"};

For Each({str}, strs,
	datetime = Informat(str, "Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;DD&amp;gt;_&amp;lt;hh24&amp;gt;&amp;lt;mm&amp;gt;&amp;lt;ss&amp;gt;");
	Write("\!N", str, " converted to time is ", datetime);
);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;20240207_163752 converted to time is 07Feb2024:16:37:52
20240208_132212 converted to time is 08Feb2024:13:22:12
20240320_180945 converted to time is 20Mar2024:18:09:45
20240321_062705 converted to time is 21Mar2024:06:27:05&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If using as formula replace str with your column&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1724910931361.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/67667i75AFF339BD413ED9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1724910931361.png" alt="jthi_0-1724910931361.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/datetime-functions-and-formats.shtml#" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/datetime-functions-and-formats.shtml#&lt;/A&gt; - Scripting Guide&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/date-and-time-functions.shtml#ww2531887" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/date-and-time-functions.shtml#ww2531887&lt;/A&gt; - JSL Syntax Reference&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2024 05:57:01 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-08-29T05:57:01Z</dc:date>
    <item>
      <title>MM/DD HH:MM conversion how to do</title>
      <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/784514#M96875</link>
      <description>&lt;P&gt;I have a time Colum in a odd format&amp;nbsp; ( do not even have Year in and&amp;nbsp; need help converting to a simply&amp;nbsp; &amp;nbsp;YY/MM/DD HH:MM&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[08/06-19:07:34.981]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[08/06-19:08:05.927]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[08/06-19:08:14.270]&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;[08/06-19:08:26.331]&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 26 Aug 2024 23:05:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/784514#M96875</guid>
      <dc:creator>TONG_SUPER</dc:creator>
      <dc:date>2024-08-26T23:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: MM/DD HH:MM conversion how to do</title>
      <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/784543#M96876</link>
      <description>&lt;P&gt;Here is the formula I used to do the conversion&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Date MDY( Num( Word( 1, :Time, "[/" ) ), Num( Word( 2, :Time, "[/-" ) ), 2024 )
+Informat( Word( 3, :Time, "[/-]" ), "hh:mm:ss" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1724716233316.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/67558iA7034EFD5E9A08C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1724716233316.png" alt="txnelson_0-1724716233316.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 23:50:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/784543#M96876</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-08-26T23:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: MM/DD HH:MM conversion how to do</title>
      <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/786541#M96922</link>
      <description>&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 20:31:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/786541#M96922</guid>
      <dc:creator>TONG_SUPER</dc:creator>
      <dc:date>2024-08-27T20:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: MM/DD HH:MM conversion how to do</title>
      <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/788788#M96979</link>
      <description>&lt;P&gt;I had another question.&amp;nbsp; I can do MM/DD/YYYY but i do not know how to add the time string in to add in it&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Source Table&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20240207_163752&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20240208_132212&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20240320_180945&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20240321_062705&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TONG_SUPER_0-1724868518757.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/67650iA64F5B32C528FA82/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TONG_SUPER_0-1724868518757.png" alt="TONG_SUPER_0-1724868518757.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;DMY conver=Date DMY(Num( Munger( :Source Table, 7, 2 ) ),Num( Munger( :Source Table, 5, 2 ) ),Num( Left( :Source Table, 4 ) ))&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 18:17:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/788788#M96979</guid>
      <dc:creator>TONG_SUPER</dc:creator>
      <dc:date>2024-08-28T18:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: MM/DD HH:MM conversion how to do</title>
      <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/788809#M96980</link>
      <description>&lt;P&gt;JMP Date/Time values are stored as the number of seconds since Midnight, January 1, 1904.&amp;nbsp; So once you have input the Date part using the DateDMY, the time part just needs to be added to the date part. The time part simply becomes the number of hours*3600 + number of minutes*60 + number of seconds.&amp;nbsp; I don't know how to interpret the 163752, but all you need to do is to determine the number of seconds in the day it represents and then add it to the Date part, and you will have your answer.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 18:24:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/788809#M96980</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-08-28T18:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: MM/DD HH:MM conversion how to do</title>
      <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/788852#M96983</link>
      <description>&lt;P&gt;sorry i was not clear.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;163752&amp;nbsp; is kind of military time for&amp;nbsp; HHMMSS&amp;nbsp; eg 4 pm 37 min and 52 sec&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 19:09:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/788852#M96983</guid>
      <dc:creator>TONG_SUPER</dc:creator>
      <dc:date>2024-08-28T19:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: MM/DD HH:MM conversion how to do</title>
      <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/788908#M96985</link>
      <description>&lt;P&gt;Given the method I specified above, the formula is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;DMY conver = Date DMY(
	Num( Munger( :Source Table, 7, 2 ) ),
	Num( Munger( :Source Table, 5, 2 ) ),
	Num( Left( :Source Table, 4 ) )
) + Num( Munger( :Source Table, 10, 2 ) ) * 3600
+Num( Munger( :Source Table, 12, 2 ) ) * 60
+Num( Munger( :Source Table, 14, 2 ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1724875205108.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/67651iC93604C1A1ED5D71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1724875205108.png" alt="txnelson_0-1724875205108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 20:00:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/788908#M96985</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-08-28T20:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: MM/DD HH:MM conversion how to do</title>
      <link>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/789411#M96991</link>
      <description>&lt;P&gt;There are a lot of different methods of converting strings to datetimes in JMP. Building it from ground up by splitting it from parts is the method which has the highest success rate but there can be easier methods, such as Format Pattern (note that In Format() has &amp;lt;&amp;lt; Use Locale argument which you might need sometimes)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

strs = {"20240207_163752", "20240208_132212", "20240320_180945", "20240321_062705"};

For Each({str}, strs,
	datetime = Informat(str, "Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;DD&amp;gt;_&amp;lt;hh24&amp;gt;&amp;lt;mm&amp;gt;&amp;lt;ss&amp;gt;");
	Write("\!N", str, " converted to time is ", datetime);
);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;20240207_163752 converted to time is 07Feb2024:16:37:52
20240208_132212 converted to time is 08Feb2024:13:22:12
20240320_180945 converted to time is 20Mar2024:18:09:45
20240321_062705 converted to time is 21Mar2024:06:27:05&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If using as formula replace str with your column&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1724910931361.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/67667i75AFF339BD413ED9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1724910931361.png" alt="jthi_0-1724910931361.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/datetime-functions-and-formats.shtml#" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/datetime-functions-and-formats.shtml#&lt;/A&gt; - Scripting Guide&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/date-and-time-functions.shtml#ww2531887" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/date-and-time-functions.shtml#ww2531887&lt;/A&gt; - JSL Syntax Reference&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 05:57:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/MM-DD-HH-MM-conversion-how-to-do/m-p/789411#M96991</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-08-29T05:57:01Z</dc:date>
    </item>
  </channel>
</rss>

