<?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: Format Date Time yyyymmdd_hhmmss in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Format-Date-Time-yyyymmdd-hhmmss/m-p/694177#M87930</link>
    <description>&lt;P&gt;You don't indicate which JMP version you have, but if possible I would use Format Pattern (I think it was added in JMP16)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
formatted_date = Format(Today(), "Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;DD&amp;gt;_&amp;lt;hh24&amp;gt;&amp;lt;mm&amp;gt;&amp;lt;ss&amp;gt;");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Other option which will work always, is to build it from start as a string using functions such as Year(), Month(), Day(), and so on&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2023 10:43:03 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-11-03T10:43:03Z</dc:date>
    <item>
      <title>Format Date Time yyyymmdd_hhmmss</title>
      <link>https://community.jmp.com/t5/Discussions/Format-Date-Time-yyyymmdd-hhmmss/m-p/694172#M87929</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am having an issue with a date-time format when save a csv file.&lt;BR /&gt;The filename should be like "&lt;STRONG&gt;Summary_20231103_082637&lt;/STRONG&gt;".&lt;BR /&gt;&lt;BR /&gt;formattedDate = Format(Today(), "yyyymmdd_hhmmss");&lt;BR /&gt;filename = Convert File Path("C:\Path\Summary_" || formattedDate || ".xlsx", absolute );&lt;BR /&gt;if(File Exists (filename),&lt;BR /&gt;dt &amp;lt;&amp;lt; Save (filename, Mode("Append")),&lt;BR /&gt;dt &amp;lt;&amp;lt; Save (filename));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;I tried to format the datetime with&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;formatDate = Format(Today(), "yyyymmdd");&lt;BR /&gt;Show(formatDate);&lt;BR /&gt;&lt;BR /&gt;Result:&amp;nbsp;"20231103"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;format1 = Format(Today(), "h:m:s");&lt;BR /&gt;Show(format1);&lt;BR /&gt;&lt;BR /&gt;Result:&amp;nbsp;"6:18:32 PM"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;format2 = Format(Today(), "&amp;lt;YYYY&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;DD&amp;gt;&amp;lt;-&amp;gt;&amp;lt;hh24&amp;gt;&amp;lt;mm&amp;gt;&amp;lt;ss&amp;gt;");&lt;BR /&gt;Show(format2);&lt;BR /&gt;&lt;BR /&gt;Result:&amp;nbsp;"11/03/2023"&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 10:25:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Format-Date-Time-yyyymmdd-hhmmss/m-p/694172#M87929</guid>
      <dc:creator>Celine1</dc:creator>
      <dc:date>2023-11-03T10:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Format Date Time yyyymmdd_hhmmss</title>
      <link>https://community.jmp.com/t5/Discussions/Format-Date-Time-yyyymmdd-hhmmss/m-p/694177#M87930</link>
      <description>&lt;P&gt;You don't indicate which JMP version you have, but if possible I would use Format Pattern (I think it was added in JMP16)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
formatted_date = Format(Today(), "Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;DD&amp;gt;_&amp;lt;hh24&amp;gt;&amp;lt;mm&amp;gt;&amp;lt;ss&amp;gt;");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Other option which will work always, is to build it from start as a string using functions such as Year(), Month(), Day(), and so on&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 10:43:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Format-Date-Time-yyyymmdd-hhmmss/m-p/694177#M87930</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-03T10:43:03Z</dc:date>
    </item>
  </channel>
</rss>

