<?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: JMP Time Formatting in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/74644#M35831</link>
    <description>&lt;P&gt;I ended up adding this to the JMP Wish List:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/JMP-Wish-List/JMP-Time-Formatting-12-v-24-hr-control/idi-p/74643#M336" target="_blank"&gt;https://community.jmp.com/t5/JMP-Wish-List/JMP-Time-Formatting-12-v-24-hr-control/idi-p/74643#M336&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Sep 2018 14:33:29 GMT</pubDate>
    <dc:creator>msharp</dc:creator>
    <dc:date>2018-09-20T14:33:29Z</dc:date>
    <item>
      <title>JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/72467#M35619</link>
      <description>&lt;P&gt;I can't get the time format to work.&amp;nbsp; According to the scripting guide the format "m/d/y h:m:s" is used for both 12hr and 24hr time... WTF?&amp;nbsp; Why would I ever want&amp;nbsp;a function to willy nilly give one or the other answer?&amp;nbsp; How do I get this to work!&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;time = today(); //3619617166
formattedTime = format(time, "m/d/y h:m:s");
print(formattedTime);  //"09/12/2018 5:12:46 PM"
//What I want: "09/12/2018 17:12:46"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;There's some cryptic notes in the Scripting Guide that make me feel it chooses 12hr or 24hrs based on your computer settings, which is a terrible idea b/c I don't want my code to break on half of my users computers.&lt;BR /&gt;&lt;BR /&gt;If formatting doesn't work, is there a simple work around?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 23:25:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/72467#M35619</guid>
      <dc:creator>msharp</dc:creator>
      <dc:date>2018-09-12T23:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/72476#M35622</link>
      <description>&lt;P&gt;I often end up using this kind of thing:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
time = 3619617166;
pad = function( {x}, if(x &amp;lt; 10, "0" || char( x ), char( x )));

pad(month(time)) || "/" || pad(day(time))|| "/" || char(year(time)) || " " || 
	pad(hour(time)) || ":" || pad(minute(time)) || ":" || pad(second(time));
// "09/12/2018 17:12:46"&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;+1 to the solution with a customizable format string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 03:07:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/72476#M35622</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2018-09-13T03:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/72536#M35651</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt;; that is a decent work around.&amp;nbsp; One note, believe you need to put hour(time, 24) to force it to 24 hour time.&amp;nbsp; It appears to default to 24 hours, but the documentation makes me feel like it wants to default to 12 hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//My update: (just slightly shorter)&lt;BR /&gt;&lt;BR /&gt;format(time, "m/d/y") || " " || pad(hour(time, 24)) || ":" || pad(minute(time)) || ":" || pad(second(time));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I also hope there's&amp;nbsp;a customizable format string solution.&amp;nbsp; If&amp;nbsp;there isn't a better&amp;nbsp;answer in the next week, I'll add the request to the JMP Wish List.&amp;nbsp; Hopefully someone from JMP can reply.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 15:25:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/72536#M35651</guid>
      <dc:creator>msharp</dc:creator>
      <dc:date>2018-09-13T15:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/74644#M35831</link>
      <description>&lt;P&gt;I ended up adding this to the JMP Wish List:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/JMP-Wish-List/JMP-Time-Formatting-12-v-24-hr-control/idi-p/74643#M336" target="_blank"&gt;https://community.jmp.com/t5/JMP-Wish-List/JMP-Time-Formatting-12-v-24-hr-control/idi-p/74643#M336&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 14:33:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/74644#M35831</guid>
      <dc:creator>msharp</dc:creator>
      <dc:date>2018-09-20T14:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256588#M50414</link>
      <description>&lt;P&gt;Just went down the rabbit hole of trying to figure out how to make date formats appear the way I want on my charts.&amp;nbsp; I never expected it to be this hard.&amp;nbsp; So I have to build it up character by character and roll my own function to pad hours/minutes/seconds with leading zeroes.&amp;nbsp; Awesome.&amp;nbsp; Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt; for the tip.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 16:42:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256588#M50414</guid>
      <dc:creator>Chris_Rodrigues</dc:creator>
      <dc:date>2020-04-07T16:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256597#M50416</link>
      <description>&lt;P&gt;Please also take a look at &lt;STRONG&gt;Help &amp;gt; JMP Documentation Library &amp;gt; Scripting Guide&lt;/STRONG&gt; and search on '&lt;EM&gt;custom functions&lt;/EM&gt;.' The information starts on page 393 for JMP 15.1 release. Here you will also find custom transformations and custom formats. These definitions can then also be used in the JMP UI interactively.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 18:15:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256597#M50416</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-04-07T18:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256607#M50418</link>
      <description>&lt;P&gt;On my charts I wanted to use the X axis label space as efficiently as possible so I didn't want things like year, # of seconds, etc. "Mon 18:00" is sufficient.&amp;nbsp; At first I thought the Format() function would be able to do this easily, but this is what I ended up using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
pad = Function( {x}, If( x &amp;lt; 10, "0" || Char( x ), Char( x ) ) );
Char( Match( Day Of Week( :value ), 1, "Sun", 2, "Mon", 3, "Tue", 4, "Wed", 5, "Thu", 6, "Fri", 7, "Sat" ) ) || " " || pad( Hour( :value, 24 ) ) ||
":" || pad( Minute( :value ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and this is the result:&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="jmp graph custom timestamp.jpg" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22836iED63F83E8BDC0896/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jmp graph custom timestamp.jpg" alt="jmp graph custom timestamp.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 18:56:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256607#M50418</guid>
      <dc:creator>Chris_Rodrigues</dc:creator>
      <dc:date>2020-04-07T18:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256633#M50421</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12851"&gt;@Chris_Rodrigues&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might take a look at the function below and, if you like it, vote for the idea on the &lt;A href="https://community.jmp.com/t5/JMP-Wish-List/JMP-Time-Formatting-12-v-24-hr-control/idi-p/74643" target="_self"&gt;JMP Wish List here&lt;/A&gt;.&amp;nbsp; I use something like this all the time and would love to see it made available as a built-in function.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
time = 3619617166;
pad = function( {x}, if(x &amp;lt; 10, "0" || char( x ), char( x )));

formatdatetime = function({time, pattern, prepend=""},
	char(substitute(pattern,
		prepend || "H", pad(hour(time, 24)),
		prepend || "h", pad(hour(time, 12)),
		prepend || "M", pad(minute(time)),
		prepend || "S", pad(second(time)),
		prepend || "m", pad(month(time)),
		prepend || "d", pad(day(time)),
		prepend || "y", char(year(time)),
		prepend || "AP", char(if(hour(time)==24, "AM", if(hour(time, 24)&amp;gt;11,"PM","AM"))),
		// the rest of the formatting options..Month name, 
		// short month name, hours without padding, etc
	))
);

formatdatetime(time, "m/d/y h:M:S AP");
// 09/12/2018 05:12:46 PM

formatdatetime(time, "ymd_HMS");
// 20180912_171246

formatdatetime(time, "hour = %h, minute = %M", "%")
// hour = 05, minute = 12&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Apr 2020 20:48:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256633#M50421</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-04-07T20:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256646#M50424</link>
      <description>&lt;P&gt;Thanks. I voted on the wish list item already&amp;nbsp; I don't particularly like any of the default date formats so I would definitely use this function if it were available as a built-in function.&amp;nbsp; Now that I know what is required, I'm past the learning curve and I can format my dates however I want.&amp;nbsp; Limitless flexibility is useful.&amp;nbsp; But if I tried to explain all this to a non-programmer Excel user I would get blank stares.&amp;nbsp; Seems excessively complicated when Excel has been able to accept date formats of "ddd hh:mm" since at least 1997.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 21:30:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/256646#M50424</guid>
      <dc:creator>Chris_Rodrigues</dc:creator>
      <dc:date>2020-04-07T21:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/698100#M88362</link>
      <description>&lt;P&gt;I'm with you, Chris.&amp;nbsp; The JMP function is idiotic.&amp;nbsp; I shouldn't have to write a script just to change a time format from AM/PM to 24h.&amp;nbsp; Other threads gave formulas for this, none of which worked.&amp;nbsp; There is ZERO reason this should not be a standard JMP format in the dropdown list. It's been 3 years since your post and still nothing from JMP.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 22:35:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/698100#M88362</guid>
      <dc:creator>Newbie_1</dc:creator>
      <dc:date>2023-11-14T22:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Time Formatting</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/698528#M88368</link>
      <description>&lt;P&gt;You can use Format Pattern to modify your date and this has most likely been JMPs solution as the wish list item has been set to Delivered.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1700026330598.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58720i5759A4A1A4C81E3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1700026330598.png" alt="jthi_0-1700026330598.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/numeric-formats.shtml#ww953202" target="_blank"&gt;Numeric Formats (jmp.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="How do I apply Custom Date (and Duration) Formats in JMP?" uid="377399" url="https://community.jmp.com/t5/Learning-Center/How-do-I-apply-Custom-Date-and-Duration-Formats-in-JMP/m-p/377399#U377399" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 05:35:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Time-Formatting/m-p/698528#M88368</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-15T05:35:31Z</dc:date>
    </item>
  </channel>
</rss>

