<?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: Formatting Asian dates to short dates in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442483#M69075</link>
    <description>&lt;P&gt;Thank you, your solution works for me!&lt;/P&gt;</description>
    <pubDate>Sat, 04 Dec 2021 04:38:51 GMT</pubDate>
    <dc:creator>cchueng</dc:creator>
    <dc:date>2021-12-04T04:38:51Z</dc:date>
    <item>
      <title>Formatting Asian dates to short dates</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442323#M69063</link>
      <description>&lt;P&gt;Many companies in Asia type their dates different from that in USA. For example, 3rd Dec. 2021, Asian companies will type it as 03/12/2021 but in USA we type it as 12/03/2021. I have a table which I parse out the dates and convert it into short dates. But the circle ones are wrong, see below image. I used the code below. How do I let JMP know that the dates extracted from the Text column are in this format days_months_year and not months_days_year?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtlog &amp;lt;&amp;lt; New Column( "vStart",Numeric,Continous, Formula(Short Date(Num(LEFT(:Text,8))) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cchueng_0-1638558344317.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38144i5CB8BC71962DA078/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cchueng_0-1638558344317.png" alt="cchueng_0-1638558344317.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Attached is the data table.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:41:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442323#M69063</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2023-06-10T23:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Asian dates to short dates</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442363#M69066</link>
      <description>&lt;P&gt;Perform these steps:&lt;/P&gt;
&lt;P&gt;1. Right click on your vStart column that has the numeric dates&lt;/P&gt;
&lt;P&gt;2. Select "Column Info..."&lt;/P&gt;
&lt;P&gt;3. Change format from Best by clicking "Best &amp;gt; Date &amp;gt; d/m/y"&lt;/P&gt;
&lt;P&gt;4. Click OK&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtlog:vStart &amp;lt;&amp;lt; Format( "d/m/y", 12 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 19:52:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442363#M69066</guid>
      <dc:creator>Mark_Zwald</dc:creator>
      <dc:date>2021-12-03T19:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Asian dates to short dates</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442431#M69069</link>
      <description>&lt;P&gt;hi mzwald,&lt;/P&gt;&lt;P&gt;How do I merge it with my code?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtlog &amp;lt;&amp;lt; New Column( "vStart",Numeric,Continous, Formula(Short Date(Num(LEFT(:Text,8))) )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Dec 2021 21:57:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442431#M69069</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-12-03T21:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Asian dates to short dates</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442432#M69070</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtlog &amp;lt;&amp;lt; New Column( "vStart", Numeric, Continuous, Formula(Short Date(Num(LEFT(:Text,8)))));
dtlog:vStart &amp;lt;&amp;lt; Format( "d/m/y", 12 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Dec 2021 22:02:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442432#M69070</guid>
      <dc:creator>Mark_Zwald</dc:creator>
      <dc:date>2021-12-03T22:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Asian dates to short dates</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442476#M69074</link>
      <description>&lt;P&gt;For the column formula use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Informat( Left( :Text, 8 ), "d/m/y" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once num(left(text,8)) is done, it is too late to fix it; num() has already guessed the string is a date and guessed the wrong format, sometimes. Each row is done independently, and num() can't tell it is switching horses mid-stream.&lt;/P&gt;
&lt;P&gt;Telling informat the correct format will get you half-way there. The second half is telling the column to use a display format. A reasonable format for checking is one that spells out month names. Here's a complete new column statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;    New Column( "vStart",
        Numeric, "Nominal",
        Format( "Date Long", 35 ),
        Input Format( "Locale Date" ),
        Formula( Informat( Left( :Text, 8 ), "d/m/y" ) )
    )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="looks correct, Nov and Dec line up." style="width: 611px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38149iD51F864E78CBFDE9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="looks correct, Nov and Dec line up." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;looks correct, Nov and Dec line up.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: The &lt;EM&gt;input format&lt;/EM&gt; (using the locale date) is silly unless you later remove the formula from the column. The input format is used if you type in a value, but you can't type values in a formula column. You'd probably want the locale's preferred format if you were reentering "Friday, December 3, 2021". The &lt;EM&gt;format&lt;/EM&gt; (using Date Long) controls how the number is formatted for display. The actual value stored, under the covers, is the number of seconds since 1jan1904. That's what the &lt;EM&gt;informat&lt;/EM&gt; function returned.&lt;/P&gt;
&lt;P&gt;You probably want continuous, not nominal. Maybe.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Dec 2021 00:58:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442476#M69074</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-12-04T00:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Asian dates to short dates</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442483#M69075</link>
      <description>&lt;P&gt;Thank you, your solution works for me!&lt;/P&gt;</description>
      <pubDate>Sat, 04 Dec 2021 04:38:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442483#M69075</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-12-04T04:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Asian dates to short dates</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442485#M69076</link>
      <description>&lt;P&gt;I got an error :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cchueng_0-1638592801128.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38150iDB7B4F2976107912/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cchueng_0-1638592801128.png" alt="cchueng_0-1638592801128.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Dec 2021 04:40:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442485#M69076</guid>
      <dc:creator>cchueng</dc:creator>
      <dc:date>2021-12-04T04:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Asian dates to short dates</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442526#M69077</link>
      <description>&lt;P&gt;In your original JSL, the column was automatically converted from &lt;EM&gt;numeric/continuous&lt;/EM&gt; (that you requested) to &lt;EM&gt;character/nominal&lt;/EM&gt; (because shortDate() returns character data.) The &lt;EM&gt;nominal&lt;/EM&gt; got picked up in my example after I copied the column's script. &lt;/P&gt;
&lt;P&gt;That's a useful message letting you know that the data in a character column does not get formatted. It can't tell you how the column became character.&lt;/P&gt;
&lt;P&gt;In your original example, this was in the log window (because shortdate() returns character):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;dtlog &amp;lt;&amp;lt; New Column( "vStart",Numeric,Continous, Formula(Short Date(Num(LEFT(:Text,8))) ) )&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Column "vStart" changed to type Character to match formula.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There was also a hint in the picture you attached: the vStart data was left-justified. JMP uses right-justification for numeric data and left-justification for character data.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Dec 2021 12:41:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-Asian-dates-to-short-dates/m-p/442526#M69077</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-12-04T12:41:27Z</dc:date>
    </item>
  </channel>
</rss>

