<?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: Convert character date and time (Jun 2, 2020 8:41:43 AM) to numeric DD MM YYYY HH:MM:SS in Community Discussions</title>
    <link>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451572#M282</link>
    <description>&lt;P&gt;Thanks Jarmo - would it be possible to show me how to deploy such a function in the software?&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jan 2022 15:57:09 GMT</pubDate>
    <dc:creator>DELANDJ1985</dc:creator>
    <dc:date>2022-01-14T15:57:09Z</dc:date>
    <item>
      <title>Convert character date and time (Jun 2, 2020 8:41:43 AM) to numeric DD MM YYYY HH:MM:SS</title>
      <link>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451428#M278</link>
      <description>&lt;P&gt;Normally manipulate this date format in excel 'Jun 2, 2020 8:41:43 AM' to be more JMP friendly but is there a method of completing this activity within the software?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 14:01:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451428#M278</guid>
      <dc:creator>DELANDJ1985</dc:creator>
      <dc:date>2022-01-14T14:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character date and time (Jun 2, 2020 8:41:43 AM) to numeric DD MM YYYY HH:MM:SS</title>
      <link>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451448#M279</link>
      <description>&lt;P&gt;If you are using JMP16 you might have luck with Format Pattern depending on your Locale Settings:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1642169144704.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38986iE77D01275DB8FD4A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1642169144704.png" alt="jthi_0-1642169144704.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 14:06:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451448#M279</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-01-14T14:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character date and time (Jun 2, 2020 8:41:43 AM) to numeric DD MM YYYY HH:MM:SS</title>
      <link>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451449#M280</link>
      <description>&lt;P&gt;Thanks for quick response Jarmo! Unfortunately i'm still using JMP 14 so i don't think i have this function.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 14:48:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451449#M280</guid>
      <dc:creator>DELANDJ1985</dc:creator>
      <dc:date>2022-01-14T14:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character date and time (Jun 2, 2020 8:41:43 AM) to numeric DD MM YYYY HH:MM:SS</title>
      <link>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451536#M281</link>
      <description>&lt;P&gt;As I don't have access to JMP14 at the moment and my locale is different (I'm not used to 12 hour clock and I have had my fair share of issues how JMP manages dates and times, especially before JMP16.1), testing for me might be a bit finicky. Depending where you need this functionality, you could create a function / custom function or use just as is. The idea is to get your string into date-time value, which JMP can then convert to what ever format you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will have to be careful with different corner cases which can make a mess of the date time and this might not handle all of them or have mistakes in it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//Converts "Jun 2, 2020 12:41:43 PM" formatted string to JMP date-time
convert_str_to_date_time = function({str}, {Default Local},

	//create month list to get month number based on index
	months = {"Jan", "Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
	{month_str, day_str, year_str, time_str, ampm_str} = Words(str, ", ");
	{hour_str, minute_str, second_str} = Words(time_str, ":");

	//Date
	year_num = Num(year_str);
	month_num = Contains(months, month_str);
	day_num = Num(day_str);

	//Time
	hour_num = Num(hour_str) + If(ampm_str == "PM", 12, 0); //will need to handle 24 -&amp;gt; 0...
	If(hour_num &amp;gt;= 24, 
		hour_num = 0;
	);
	minute_num = Num(minute_str);
	second_num = Num(second_str);

	//date-time value
	date_time_val = Date DMY(day_num, month_num, year_num) + In Hours(hour_num) + In Minutes(minute_num) + second_num;

	return(date_time_val)
);
str1 = "Jun 2, 2020 8:41:43 AM";
str2 = "Jun 2, 2020 12:41:43 PM";

date_time = convert_str_to_date_time(str1); // As Date(date_time) = 02Jun2020:08:41:43;
Show(As Date(date_time));
date_time = convert_str_to_date_time(str2); // As Date(date_time) = 02Jun2020:00:41:43;
Show(As Date(date_time));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 15:23:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451536#M281</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-01-14T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character date and time (Jun 2, 2020 8:41:43 AM) to numeric DD MM YYYY HH:MM:SS</title>
      <link>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451572#M282</link>
      <description>&lt;P&gt;Thanks Jarmo - would it be possible to show me how to deploy such a function in the software?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 15:57:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451572#M282</guid>
      <dc:creator>DELANDJ1985</dc:creator>
      <dc:date>2022-01-14T15:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character date and time (Jun 2, 2020 8:41:43 AM) to numeric DD MM YYYY HH:MM:SS</title>
      <link>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451583#M283</link>
      <description>&lt;P&gt;One option would be to create formula like in the attached file in Column 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if JMP14 has Custom functions, you could use them: &lt;A href="https://www.jmp.com/support/help/en/15.0/index.shtml#page/jmp/create-custom-functions-transforms-and-formats.shtml" target="_blank" rel="noopener"&gt;JMP15.0 Help - Create Custom Functions, Transforms, and Formats&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 16:10:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Community-Discussions/Convert-character-date-and-time-Jun-2-2020-8-41-43-AM-to-numeric/m-p/451583#M283</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-01-14T16:10:05Z</dc:date>
    </item>
  </channel>
</rss>

