<?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: How do I convert a nummeric string into a date? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53188#M30109</link>
    <description>Thanks - that helps</description>
    <pubDate>Thu, 15 Mar 2018 12:53:10 GMT</pubDate>
    <dc:creator>JulieSAppel</dc:creator>
    <dc:date>2018-03-15T12:53:10Z</dc:date>
    <item>
      <title>How do I convert a numeric "string" into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/52625#M29797</link>
      <description>&lt;P&gt;I´m a new user and I´m trying to convert a nummeric string into a jmp date format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried creating a new column by&amp;nbsp;concatenating a character string so that could at least get my desired "ddmmyyy" output:&lt;/P&gt;
&lt;P&gt;(Substr( :START_DATE, 7, 2 ) || Substr( :START_DATE, 5, 2 )) ||Substr( :START_DATE, 1, 4 )&amp;nbsp;but that didnt get´me any further.&lt;/P&gt;
&lt;P&gt;Any ideas on this?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jpeg.PNG" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10175iEB0D0EBDE8566E74/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jpeg.PNG" alt="jpeg.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 18:18:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/52625#M29797</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2018-03-30T18:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/52631#M29799</link>
      <description>&lt;P&gt;You are really close; you'll need char(start_date) to get a string from the number. I tried a slightly different approach for a column formula&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Informat( Regex( Char( :START_DATE ), "(\d\d\d\d)(\d\d)(\d\d)", "\1-\2-\3" ), "ymd" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and set the column's format&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Output format different from input format" style="width: 667px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9714i0C5B1B50D5A0E134/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Output format different from input format" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Output format different from input format&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;JMP's preferred internal representation for dates is the JMP date-time value which is a numeric value that can be formatted with a number of different formats.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 12:54:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/52631#M29799</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2018-03-06T12:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/52632#M29800</link>
      <description>&lt;P&gt;Here is a simple script to do the same thing that Craige did&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

For Each Row(
	:start_date = Date MDY(
		Num( Substr( Char( :start_date ), 5, 2 ) ),
		Num( Right( Char( :start_date ), 2 ) ),
		Num( Left( Char( :start_date ), 4 ) )
	)
);
dt:start_date &amp;lt;&amp;lt; format("ddmmyyyy",12);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Mar 2018 13:00:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/52632#M29800</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-06T13:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/52633#M29801</link>
      <description>&lt;P&gt;Jim - I got started wrong. The yyyymmdd format works without regex or substr:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Informat( Char( :START_DATE ), "yyyymmdd" )&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 13:10:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/52633#M29801</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2018-03-06T13:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53176#M30102</link>
      <description>&lt;P&gt;Thanks - this works. Im not entirely sure&amp;nbsp;I understand it completely though.&lt;/P&gt;&lt;P&gt;Is the&amp;nbsp;&lt;SPAN class="token string"&gt;"(\d\d\d\d)(\d\d)(\d\d)" stating the input format? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token string"&gt;What is &amp;nbsp;"\1-\2-\3" doing?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token string"&gt;Thanks for helping out &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 10:06:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53176#M30102</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2018-03-15T10:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53177#M30103</link>
      <description>&lt;P&gt;Thanks for sharing. I understand this better, however it only works for me in the first row. After that it just returns "missing values".&lt;/P&gt;&lt;P&gt;Also what does the "12" do in&lt;/P&gt;&lt;P&gt;dt&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt;start_date &lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"ddmmyyyy"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;12&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 10:13:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53177#M30103</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2018-03-15T10:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53180#M30104</link>
      <description>&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Uncharted/Regex/ba-p/21008" target="_blank"&gt;this post&lt;/A&gt; is about the (\d\d) part. The parens create groups and the \d matches a single digit.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Uncharted/Back-Reference/ba-p/21267" target="_blank"&gt;this post&lt;/A&gt;&amp;nbsp;is about the \1-\2-\3. those are back references and extra text (the hyphens) inserted into the result string. The numbers refer to the matching open parenthesis.&lt;/P&gt;
&lt;P&gt;Regex is a powerful tool, there are many tutorials on the internet.&lt;/P&gt;
&lt;P&gt;This example is overkill for the problem at hand; JMP has a date informat that already matches the format of your numbers after you convert them to characters.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:39:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53180#M30104</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2018-03-15T11:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53181#M30105</link>
      <description>&lt;P&gt;1.&amp;nbsp;Given the sample data table you provided, the script that I posted works fine. See attached file&lt;/P&gt;
&lt;P&gt;2. the 12 is the width of the format display.&amp;nbsp; See:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Scripting Index==&amp;gt;Data Table==&amp;gt;Column Scripting&lt;/P&gt;
&lt;P&gt;for a descripting and examples&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:55:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53181#M30105</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-15T11:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53186#M30107</link>
      <description>&lt;P&gt;There are some differences between how you use Jim's script and the column formula.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The column formula makes a new column based on the old data. If new rows are added, the formula runs automatically to convert the date values. The old data column can't be deleted unless the formula is removed first.&lt;/LI&gt;
&lt;LI&gt;The script is run once, from a script editor. Jim's script converts the column in place, changing the number from the original representation to a JMP date-time representation. If more data is added after the script is run, it should be added using the JMP date-time format the column expects.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I think the question you might want answered is "how did I get these dates JMP doesn't like, and what would a better approach be?"&lt;/P&gt;
&lt;P&gt;When you imported this data into JMP, possibly from a CSV file, or when you typed it in to a fresh table, JMP saw a number and made a numeric column. To make JMP see a date in 20180315 rather than&amp;nbsp;&lt;SPAN&gt;20,180,315 you need to tell JMP to interpret the data as yyyymmdd format. You can do that with the column proerties in a data table and specify both the informat and the format.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="informat yyyymmdd format monddyyyy" style="width: 153px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9854iC56C299C172DB4E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="informat yyyymmdd format monddyyyy" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;informat yyyymmdd format monddyyyy&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Input Format available after choosing Format" style="width: 434px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9855i0CED39C21DFF50EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Input Format available after choosing Format" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Input Format available after choosing Format&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you are using text file import to get the data from a CSV file, you can also specify a format for the column using the red triangle above the column on the second page of the preview wizard.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Text import preview wizard second page" style="width: 347px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9856i8FB7CBABBBC143F0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture3.PNG" alt="Text import preview wizard second page" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Text import preview wizard second page&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Finally, JMP's date-time values are represented as the number of seconds since 1Jan1904.&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/14/date-time-functions.shtml" target="_blank"&gt;https://www.jmp.com/support/help/14/date-time-functions.shtml&lt;/A&gt;&amp;nbsp;has a lot more information.&amp;nbsp; If you see a huge number that makes no sense, it probably needs a format. You can change the output format,&amp;nbsp;showing 03 or Mar, since the internal representation stays the same.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 12:40:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53186#M30107</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2018-03-15T12:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53188#M30109</link>
      <description>Thanks - that helps</description>
      <pubDate>Thu, 15 Mar 2018 12:53:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53188#M30109</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2018-03-15T12:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53190#M30111</link>
      <description>Actually, when I run it on the test file I get missing data in all of the rows. I use JMP 12 - can that be the reason?</description>
      <pubDate>Thu, 15 Mar 2018 13:10:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53190#M30111</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2018-03-15T13:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a nummeric string into a date?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53193#M30113</link>
      <description>&lt;P&gt;No sorry it works now&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 13:17:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-convert-a-numeric-quot-string-quot-into-a-date/m-p/53193#M30113</guid>
      <dc:creator>JulieSAppel</dc:creator>
      <dc:date>2018-03-15T13:17:22Z</dc:date>
    </item>
  </channel>
</rss>

