<?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 Time to Date Time in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/240402#M47508</link>
    <description>Thank you TxNelson for your prompt reply! This worked perfectly!&lt;BR /&gt;&lt;BR /&gt;Since I am trying to graph the data, I found a work around to leave the column in numeric format with the seconds since 1904, and then change the axis of the graph to the appropriate date format.&lt;BR /&gt;However, I like your solution better since it directly addresses what I intended.&lt;BR /&gt;&lt;BR /&gt;Very much appreciate your support!&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 07 Jan 2020 21:36:21 GMT</pubDate>
    <dc:creator>JensRiege</dc:creator>
    <dc:date>2020-01-07T21:36:21Z</dc:date>
    <item>
      <title>Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/53695#M30346</link>
      <description>&lt;P&gt;Having difficulty converting to a numeric date time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JMP log error:&amp;nbsp;Column "Date-Time" changed to type Character to match formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date::Time original format:&lt;/P&gt;
&lt;P&gt;01:28:2018::02:14:08:099&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I am trying to do (after many attempts from various posts):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt&amp;lt;&amp;lt; new column ("Date-Time", numeric, formula(
rawdate = substitute(trim(substr(:TimeStamp,1,10)),":","/");
rawtime = (trim(substr(:TimeStamp,13,12)));
datetme = rawdate || " " || rawtime;
//informat(datetime);
//as date(datetme);
)
) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Informat() and as date() give me "." result&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 13:37:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/53695#M30346</guid>
      <dc:creator>KST-CPT</dc:creator>
      <dc:date>2018-03-23T13:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/53703#M30348</link>
      <description>&lt;P&gt;Here is the conversion formula I came up with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Date MDY(
	Num( Substr( :TimeStamp, 1, 2 ) ),
	Num( Substr( :TimeStamp, 4, 2 ) ),
	Num( Substr( :TimeStamp, 7, 4 ) )
) 
+ 3600 * Num( Substr( :TimeStamp, 13, 2 ) ) 
+ 60 * Num( Substr( :TimeStamp, 16, 2 ) )
+Num( Substr( :TimeStamp, 19, 2 ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and I am specifying a format of&amp;nbsp; &amp;nbsp; &amp;nbsp;m/d/y h:m:s&amp;nbsp; &amp;nbsp; for the new column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 02:28:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/53703#M30348</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-23T02:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/53717#M30354</link>
      <description>&lt;P&gt;That worked flawlessly. I added to the column properties in the script: continuous, format("&lt;SPAN&gt;m/d/y h:m:s").&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am not a software engineer or related, just trying to hack my way through this. I guess I don't understand how date and time work in JMP.&amp;nbsp; The time stamp does not need to be in "MM/DD/YYYY hh:mm:ss:msc" format? From what I found in other posts, I thought that was the correct format when converting from character to date/time.&amp;nbsp; I also see that you grab each number alone and then change the type, I am assuming that JMP could not handle the character inputs mixed in with the numerics?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much again for your help.&amp;nbsp; Much appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 13:52:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/53717#M30354</guid>
      <dc:creator>KST-CPT</dc:creator>
      <dc:date>2018-03-23T13:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/208542#M41902</link>
      <description>a quick question here;&lt;BR /&gt;If we want to keep the last three digits of decimals for sec (miliseconds) in time format, how do we keep it in formula?&lt;BR /&gt;Thanks much from newbie.</description>
      <pubDate>Thu, 16 May 2019 01:32:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/208542#M41902</guid>
      <dc:creator>joelahn</dc:creator>
      <dc:date>2019-05-16T01:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/208556#M41904</link>
      <description>Can you please supply a sample of your character string date time column.  I am assuming that all you have to do is to strip off the seconds and milliseconds, convert that string to a numeric, and then add that to calculation of the JMP Date/Time value.</description>
      <pubDate>Thu, 16 May 2019 02:58:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/208556#M41904</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-05-16T02:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/208610#M41909</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;says, we could use some more detail and an example but it may be that you just need to specify the number of decimals to display in the format of your column.&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="JMPScreenSnapz006.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17243iD8C2C64BEB551AC7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JMPScreenSnapz006.png" alt="JMPScreenSnapz006.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 12:30:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/208610#M41909</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2019-05-16T12:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/240389#M47504</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I reviewed several posts to address this same issue, and am still running into the column getting converted back to character "to match the formula" , per comments in the log file.&lt;/P&gt;
&lt;P&gt;I have a table with a Date column "New Date" in string format with entries in the format "MM/DD/YYYY"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to apply your solution to this column:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column ("Date2", Numeric, "Continuous",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Formula ( Date MDY(Num( Substr( :New_Date, 1, 2 ) ),
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Num( Substr( :New_Date, 4, 2 ) ),
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Num( Substr( :New_Date, 7, 4 ) ))));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which creates a numeric date column with the standard JMP date format in seconds (e.g. "3651955200") for 9/22/2019.&lt;/P&gt;
&lt;P&gt;I then created another column to convert it to a standard date format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column ("Date3", Numeric, "Continuous", Formula ( Abbrev Date(Date2)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But running this just converted the data back to character format when I ran it...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Column "Date3" changed to type Character to match formula.&lt;/PRE&gt;
&lt;P&gt;Can you help with the correct conversion procedure?&lt;/P&gt;
&lt;P&gt;I am running out of options to try...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help you can provide.&lt;/P&gt;
&lt;P&gt;-Jens&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 19:04:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/240389#M47504</guid>
      <dc:creator>JensRiege</dc:creator>
      <dc:date>2020-01-08T19:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/240392#M47506</link>
      <description>&lt;P&gt;What you are missing is the understanding of using a Format to instruct JMP to take the numeric Date value and display it in a Date Format.&amp;nbsp; A modification of your JSL will show you the simple change to make your code work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column( "Date2",
	Numeric,
	"Continuous",
	Formula(
		Date MDY(
			Num( Substr( :New_Date, 1, 2 ) ),
			Num( Substr( :New_Date, 4, 2 ) ),
			Num( Substr( :New_Date, 7, 4 ) )
		)
	),
	Format( "m/d/y", 10)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2020 19:54:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/240392#M47506</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-07T19:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date Time to Date Time</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/240402#M47508</link>
      <description>Thank you TxNelson for your prompt reply! This worked perfectly!&lt;BR /&gt;&lt;BR /&gt;Since I am trying to graph the data, I found a work around to leave the column in numeric format with the seconds since 1904, and then change the axis of the graph to the appropriate date format.&lt;BR /&gt;However, I like your solution better since it directly addresses what I intended.&lt;BR /&gt;&lt;BR /&gt;Very much appreciate your support!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Jan 2020 21:36:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-Character-Date-Time-to-Date-Time/m-p/240402#M47508</guid>
      <dc:creator>JensRiege</dc:creator>
      <dc:date>2020-01-07T21:36:21Z</dc:date>
    </item>
  </channel>
</rss>

