<?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: parsing datetime field in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5970#M5969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately there is some spurious locale dependency. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, this code give different results depending on locale (but time settings does not matter):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier; font-size: 12px; color: #000000;"&gt;a1 &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier; font-size: 12px; color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier; font-size: 12px; color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193; font-family: Courier; font-size: 12px;"&gt;"11/9/2012 8:58:19 AM"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier; font-size: 12px; color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;a2 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"11/9/2012 8:58:19"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;a3 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"11-9-2012 8:58:19 AM"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;a4 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"11-9-2012 8:58:19"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;Show&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;/SPAN&gt;Parse Date&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; a1 &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Parse Date&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; a2 &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Parse Date&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; a3 &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Parse Date&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; a4 &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="font-family: Courier; font-size: 12px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="font-family: Courier; font-size: 12px;"&gt;&lt;STRONG&gt;//JMP 10.0.1 in OS X 10.8.2 region set to "Sweden", 24 hour time&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a1) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a2) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a3) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a4) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;//Same computer, but region set to "USA", &lt;STRONG style="font-family: Courier; font-size: 12px;"&gt; 24 hour time&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a1) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a2) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a3) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a4) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;STRONG style="font-family: Courier; font-size: 12px;"&gt;//Same computer, region set to "UK", &lt;STRONG style="font-family: Courier; font-size: 12px;"&gt; 12 hour time&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a1) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a2) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a3) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a4) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;STRONG style="font-family: Courier; font-size: 12px;"&gt;//Same computer, region set to "UK", &lt;STRONG style="font-family: Courier; font-size: 12px;"&gt; 24 hour time&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a1) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a2) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a3) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a4) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Nov 2012 22:47:11 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2012-11-15T22:47:11Z</dc:date>
    <item>
      <title>parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5961#M5960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to parse a date+time but without success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = "11/9/2012 8:58:19 AM";&lt;/P&gt;&lt;P&gt;b = Parse Date(a, "d/m/y h:m:s"); // Returns "."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to parse a date+time like this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 13:35:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5961#M5960</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-15T13:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5962#M5961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure why you are having trouble. In 10.0.1 if I run your script with a "show()" added:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = "11/9/2012 8:58:19 AM";&lt;/P&gt;&lt;P&gt;b = Parse Date(a, "d/m/y h:m:s"); &lt;/P&gt;&lt;P&gt;show(a, b)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get this in the Log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = "11/9/2012 8:58:19 AM";&lt;/P&gt;&lt;P&gt;b = 11Sep2012:08:58:19;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 14:34:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5962#M5961</guid>
      <dc:creator>mpb</dc:creator>
      <dc:date>2012-11-15T14:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5963#M5962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It could depend on your locale.&amp;nbsp; Are you outside of the US?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might work better for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;c &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;informat&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;a&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;"d/m/y h:m:s"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10.0pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 14:41:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5963#M5962</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2012-11-15T14:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5964#M5963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the datetime is in the form 11SEP2012 8:58:19 AM then this works perfectly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; a="11SEP2012 8:58:19 AM";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; b=input(a,datetime24.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; format b datetime19.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put b=;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if the datepart is formatted with /'s 11/9/2012 it falls apart!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 14:52:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5964#M5963</guid>
      <dc:creator>chrisselley</dc:creator>
      <dc:date>2012-11-15T14:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5965#M5964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris: is that JMP or SAS code?&amp;nbsp; The question was regarding JMP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 15:15:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5965#M5964</guid>
      <dc:creator />
      <dc:date>2012-11-15T15:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5966#M5965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm&amp;nbsp; indeed outside US, but I don't understand why that would effect parsing of dates in this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With &lt;SPAN style="font-family: 'Courier New'; color: #0000dd; font-size: 10pt;"&gt;informat&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;a&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;"d/m/y h:m:s"&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;); &lt;/STRONG&gt;the results are the same (I think that informat and parse date are equivalent?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;a = "11/9/2012 8:58:19 AM";&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;b = .;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;c = .;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;My JMP Pro version is 9.0.3&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 15:36:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5966#M5965</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-15T15:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5967#M5966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out this link: &lt;A __default_attr="38423" __jive_macro_name="thread" class="jive_macro jive_macro_thread" href="https://community.jmp.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need to replace the slashes with dashes or periods as mentioned by MS in this discussion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 15:53:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5967#M5966</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2012-11-15T15:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5968#M5967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think my locale the issue, it is set to 24 hour format (13:00) which makes parsing of AM/PM dates not possible...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;Show(Informat("11/9/2012 8:58:19 AM", "m/d/y h:m:s")); &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;Show(Informat("11/9/2012 8:58:19", "m/d/y h:m:s"));&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;Results in: &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Informat("11/9/2012 8:58:19 AM", "m/d/y h:m:s") = .;&lt;/P&gt;&lt;P&gt;Informat("11/9/2012 8:58:19", "m/d/y h:m:s") = 09Nov2012:08:58:19;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems there is no way to specify AM/PM in the date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now I can do this ugly hack...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;f = function({datetimestring}, &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; size = length(datetimestring); &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t = left(datetimestring, size - 3); &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; d = Parse Date(t, "d/m/y h:m:s"); &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Right(datetimestring, 2) == "PM", Date Increment(d, "Hour", 12, "actual"), d) &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;CODE&gt;); &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;show(f("11/9/2012 8:58:19 AM")); &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;show(f("11/9/2012 8:58:19 PM")); &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;11Sep2012:08:58:19; &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;11Sep2012:20:58:19;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 16:56:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5968#M5967</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-15T16:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5969#M5968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Parse Date() function and Informat() function are aliases of each other and neither &lt;EM&gt;requires&lt;/EM&gt; a second argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When no second argument is supplied JMP will try to interpret the string as a date, time or datetime using a variety of formats. This will almost always work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It certainly does in this case, regardless of the locale setting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;a &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"11/9/2012 8:58:19 AM"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;b &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #032ce4;"&gt;Parse Date&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;a&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;/*:&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;09Nov2012:08:58:19&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;//:*/&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;a &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"11/9/2012 8:58:19 PM"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;b &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #032ce4;"&gt;Parse Date&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;a&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;/*:&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier; color: #008f00;"&gt;09Nov2012:20:58:19&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 22:06:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5969#M5968</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2012-11-15T22:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5970#M5969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately there is some spurious locale dependency. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, this code give different results depending on locale (but time settings does not matter):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier; font-size: 12px; color: #000000;"&gt;a1 &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier; font-size: 12px; color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier; font-size: 12px; color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193; font-family: Courier; font-size: 12px;"&gt;"11/9/2012 8:58:19 AM"&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier; font-size: 12px; color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;a2 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"11/9/2012 8:58:19"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;a3 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"11-9-2012 8:58:19 AM"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;a4 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"11-9-2012 8:58:19"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;Show&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;/SPAN&gt;Parse Date&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; a1 &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Parse Date&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; a2 &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Parse Date&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; a3 &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Parse Date&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; a4 &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="font-family: Courier; font-size: 12px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="font-family: Courier; font-size: 12px;"&gt;&lt;STRONG&gt;//JMP 10.0.1 in OS X 10.8.2 region set to "Sweden", 24 hour time&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a1) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a2) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a3) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a4) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;//Same computer, but region set to "USA", &lt;STRONG style="font-family: Courier; font-size: 12px;"&gt; 24 hour time&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a1) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a2) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a3) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a4) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;STRONG style="font-family: Courier; font-size: 12px;"&gt;//Same computer, region set to "UK", &lt;STRONG style="font-family: Courier; font-size: 12px;"&gt; 12 hour time&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a1) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a2) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a3) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a4) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;&lt;STRONG style="font-family: Courier; font-size: 12px;"&gt;//Same computer, region set to "UK", &lt;STRONG style="font-family: Courier; font-size: 12px;"&gt; 24 hour time&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a1) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a2) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a3) = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;Parse Date(a4) = 09Nov2012:08:58:19;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 22:47:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5970#M5969</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2012-11-15T22:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: parsing datetime field</title>
      <link>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5971#M5970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks MS, this makes clear what is going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It guess there is no way to specify AM/PM format as the "format" parameter in Parse Date (like %p with strptime in C)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 09:29:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/parsing-datetime-field/m-p/5971#M5970</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-19T09:29:50Z</dc:date>
    </item>
  </channel>
</rss>

