<?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: Setting CSV Import Default Date Time Format in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62195#M33510</link>
    <description>Thank you for the comprehensive response! I'll have to get my head around the work-around you've posted to understand how to incorporate it into my script</description>
    <pubDate>Thu, 05 Jul 2018 11:38:51 GMT</pubDate>
    <dc:creator>David_</dc:creator>
    <dc:date>2018-07-05T11:38:51Z</dc:date>
    <item>
      <title>Setting CSV Import Default Date Time Format</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/58781#M32455</link>
      <description>&lt;P&gt;I've been using a modified version of the script here &lt;A href="https://community.jmp.com/t5/JMP-Scripts/Combine-multiple-txt-or-csv-files/ta-p/24083" target="_self"&gt;Combine-multiple-txt-or-csv-files&lt;/A&gt;&amp;nbsp;to import multiple (1000's) of CSV files. The problem is that it imports any date in MM/DD/YY which, if you don't live in the USA, means that&amp;nbsp;the dates flip-flop between being correct and incorrect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only solution I've found is that you can specifiy the import settings when creating the temp file to hold the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=open(fileopen,private,
			
	New Column( "CycleStartDate&amp;amp;Time",
		Numeric,
		"Continuous",
		Format( "d/m/y h:m:s", 22, 0 ),
		Input Format( "d/m/y h:m:s", 0 )
	),
	New Column( "CycleEndData&amp;amp;Time",
		Numeric,
		"Continuous",
		Format( "d/m/y h:m:s", 22, 0 ),
		Input Format( "d/m/y h:m:s", 0 )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This seems like a bit of a backwards way to do it as if the name of the date field changes it will revert back to MM/DD/YY!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been scratching my head for about about an hour and a half (or 30:01 if you're American) but can't find a nicer way to do this...&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 12:05:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/58781#M32455</guid>
      <dc:creator>David_</dc:creator>
      <dc:date>2018-05-31T12:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Setting CSV Import Default Date Time Format</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/58782#M32456</link>
      <description>&lt;P&gt;In fact that solution does not work: for example the date saved as "10/1/2018 9:50:46" is imported into JMP as "01/10/2018 09:50:46".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 12:52:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/58782#M32456</guid>
      <dc:creator>David_</dc:creator>
      <dc:date>2018-05-31T12:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Setting CSV Import Default Date Time Format</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62182#M33505</link>
      <description>&lt;P&gt;I still haven't found a good solution to this other than creating a whole new temp file with each column setup before importing the data into it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to fix this file import bug?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 07:41:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62182#M33505</guid>
      <dc:creator>David_</dc:creator>
      <dc:date>2018-07-05T07:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Setting CSV Import Default Date Time Format</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62194#M33509</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Several answers, none perfect:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In JMP 14 you can use multiple file import, which will leave the data in character format. You can then change the column format from character to numeric with the appropriate data format, manually, or with scripting.&lt;/LI&gt;
&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;In JMP 13 specifying the column format should work.&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;JMP's text file import looks at all the dates in the a column to find a day &amp;gt; 12 to infer the proper format; currently the fallback is mm-dd-yyyy. I will look at creating a preference for that.&lt;/LI&gt;
&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;Here's a work-around that might help.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, create a table with an ambiguous column:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;filename = savetextfile(&lt;BR /&gt;"$temp/date.csv","date1,date2&lt;BR /&gt;31/10/2018 23:59:59,2/5/2018 00:00:00&lt;BR /&gt;1/9/2018 00:00:00,3/7/2018 00:00:00"&lt;BR /&gt;);&lt;BR /&gt;// date1 is clearly mm/dd/yy&lt;BR /&gt;// date2 is not clear, there are no days &amp;gt; 12&lt;BR /&gt;&lt;BR /&gt;dt = open(filename);&lt;BR /&gt;// examine what happened&lt;BR /&gt;dt&amp;lt;&amp;lt;newcolumn("month1",formula(month(date1)));&lt;BR /&gt;dt&amp;lt;&amp;lt;newcolumn("month2",formula(month(date2)));&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date1 is d/m/y, date2 is m/d/y, source script high lighted" style="width: 648px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11390i8E80313AAAD9FD1C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture5.PNG" alt="date1 is d/m/y, date2 is m/d/y, source script high lighted" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;date1 is d/m/y, date2 is m/d/y, source script high lighted&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The Source script looks like this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="High lighting the two date formats" style="width: 402px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11387iC335E1B102D4190E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="High lighting the two date formats" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;High lighting the two date formats&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;JSL&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;can&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;edit the source script, substituting the desired format. Then run the modified script and add some columns to show off the month:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;script = dt&amp;lt;&amp;lt;GetProperty("source");&lt;BR /&gt;close(dt,"nosave"); // no longer needed&lt;BR /&gt;&lt;BR /&gt;// change m/d/y to d/m/y&lt;BR /&gt;substituteInto(script,"m/d/y h:m:s","d/m/y h:m:s");&lt;BR /&gt;&lt;BR /&gt;// re-open the table with the modified script&lt;BR /&gt;dt = eval(script);&lt;BR /&gt;&lt;BR /&gt;// examine what happened&lt;BR /&gt;dt&amp;lt;&amp;lt;newcolumn("month1",formula(month(date1)));&lt;BR /&gt;dt&amp;lt;&amp;lt;newcolumn("month2",formula(month(date2)));&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date2 is now d/m/y" style="width: 413px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11391i0610DC3FDA79D9EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture6.PNG" alt="date2 is now d/m/y" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;date2 is now d/m/y&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 11:28:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62194#M33509</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2018-07-05T11:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Setting CSV Import Default Date Time Format</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62195#M33510</link>
      <description>Thank you for the comprehensive response! I'll have to get my head around the work-around you've posted to understand how to incorporate it into my script</description>
      <pubDate>Thu, 05 Jul 2018 11:38:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62195#M33510</guid>
      <dc:creator>David_</dc:creator>
      <dc:date>2018-07-05T11:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting CSV Import Default Date Time Format</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62199#M33513</link>
      <description>&lt;P&gt;Welcome!&lt;/P&gt;
&lt;P&gt;If you have access to JMP 14 and are opening 1000's of CSVs, please take a look at the multiple file import. It is likely to be a lot faster because it uses threading to open multiple files at a time.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 12:16:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-CSV-Import-Default-Date-Time-Format/m-p/62199#M33513</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2018-07-05T12:16:19Z</dc:date>
    </item>
  </channel>
</rss>

