<?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 Converting Date from String format (d/m/y) to Numeric value (ddMonyyyy) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Converting-Date-from-String-format-d-m-y-to-Numeric-value/m-p/216245#M43201</link>
    <description>&lt;P&gt;I have a String column with date values in format "d/m/y",&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Date Capture.PNG" style="width: 72px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18185iB23D244A64262222/image-size/large?v=v2&amp;amp;px=999" role="button" title="Date Capture.PNG" alt="Date Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;however when converting via jsl using the following script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( dt, "Date" ) &amp;lt;&amp;lt; data type( numeric );
Column( dt, "Date" ) &amp;lt;&amp;lt; Set modeling type( "Continuous" );
Column( dt, "Date" ) &amp;lt;&amp;lt; Format( "ddMonyyyy" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Date change capture.PNG" style="width: 72px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18186i639A934D577AE7BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Date change capture.PNG" alt="Date change capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;it returns it in the correct "ddMonyyyy" format, but it has swapped month with day so instead of seeing 05May2018 it shows 05Sep2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From executing the script line by line I can see that when it converts the data type from string to numeric the value that gives a value of 3618950400, which corresponds to 05Sep2018, I believe this is due to jmp interpreting m/d/y as being the regional date and time settings (which I cannot change).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However if I go to change the Date columns format manually I can get the correct Date output&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Date last capture.PNG" style="width: 796px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18184iB8CB57BD26584F1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Date last capture.PNG" alt="Date last capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can correct this by manipulating the string and swapping the day and month with one another but this is far from desireable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other way of achieving this using JSL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2019 14:15:34 GMT</pubDate>
    <dc:creator>itsalkskeith</dc:creator>
    <dc:date>2019-07-04T14:15:34Z</dc:date>
    <item>
      <title>Converting Date from String format (d/m/y) to Numeric value (ddMonyyyy)</title>
      <link>https://community.jmp.com/t5/Discussions/Converting-Date-from-String-format-d-m-y-to-Numeric-value/m-p/216245#M43201</link>
      <description>&lt;P&gt;I have a String column with date values in format "d/m/y",&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Date Capture.PNG" style="width: 72px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18185iB23D244A64262222/image-size/large?v=v2&amp;amp;px=999" role="button" title="Date Capture.PNG" alt="Date Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;however when converting via jsl using the following script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( dt, "Date" ) &amp;lt;&amp;lt; data type( numeric );
Column( dt, "Date" ) &amp;lt;&amp;lt; Set modeling type( "Continuous" );
Column( dt, "Date" ) &amp;lt;&amp;lt; Format( "ddMonyyyy" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Date change capture.PNG" style="width: 72px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18186i639A934D577AE7BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Date change capture.PNG" alt="Date change capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;it returns it in the correct "ddMonyyyy" format, but it has swapped month with day so instead of seeing 05May2018 it shows 05Sep2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From executing the script line by line I can see that when it converts the data type from string to numeric the value that gives a value of 3618950400, which corresponds to 05Sep2018, I believe this is due to jmp interpreting m/d/y as being the regional date and time settings (which I cannot change).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However if I go to change the Date columns format manually I can get the correct Date output&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Date last capture.PNG" style="width: 796px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18184iB8CB57BD26584F1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Date last capture.PNG" alt="Date last capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can correct this by manipulating the string and swapping the day and month with one another but this is far from desireable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other way of achieving this using JSL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 14:15:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Converting-Date-from-String-format-d-m-y-to-Numeric-value/m-p/216245#M43201</guid>
      <dc:creator>itsalkskeith</dc:creator>
      <dc:date>2019-07-04T14:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Date from String format (d/m/y) to Numeric value (ddMonyyyy)</title>
      <link>https://community.jmp.com/t5/Discussions/Converting-Date-from-String-format-d-m-y-to-Numeric-value/m-p/216255#M43202</link>
      <description>&lt;P&gt;The &amp;lt;&amp;lt;Data Type() message will take the Format() and Input Format() as well, so you can do it all in one step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Date &amp;lt;&amp;lt; data type( "numeric", Format( "ddMonYYYY" ), Input format( "ddmmyyyy" ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jul 2019 14:31:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Converting-Date-from-String-format-d-m-y-to-Numeric-value/m-p/216255#M43202</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2019-07-04T14:31:29Z</dc:date>
    </item>
  </channel>
</rss>

