<?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 formatting time within a (decimal-date-time()) statement in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-time-within-a-decimal-date-time/m-p/721462#M626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am&amp;nbsp;developing in Survey123 Connect version 3.10.239.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to let a user know when the inspection of a structure is to be repeated. I start with a field ${currinspdate} that is by default now().&amp;nbsp; I give the user a choice of inspection frequency (i yr, 3 yr, 5 yr, and 10 yr) and I want the results to be in a traditional Mon dd, YYYY format.&amp;nbsp; The results are currently a number.&amp;nbsp; I have tried&amp;nbsp; date(decimal-date-time(formatDate)+365) formula and get a number but cannot get this in Mon dd, YYYY format.&amp;nbsp; &amp;nbsp; I have tried breaking it down to just date(decimal-date-time(now()+365) but get the same numeric results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a calculate type field with the calculation format-date(${currinspdate}, '%b %d, %Y"), then&amp;nbsp;trying the format date(decimal-date-time (${currinspdate} + 365). Error message "ReferenceError: formatDat"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is odd?&amp;nbsp; This formula worked in an older RC version using the entire formula:&lt;/P&gt;&lt;P&gt;if(${MONITOR}='1YR',date(decimal-date-time(now()+365),if(${MONITOR}='3YR',date(decimal-date-time(now())+1095),if(${MONITOR}='5YR',date(decimal-date-time(now())+1825),date(decimal-date-time(now())+3650))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attachment look toward the bottom for the section monattr&amp;nbsp; Next Inspection Schedule.&amp;nbsp; Todays Date is captured at the very beginning currinspdate&amp;nbsp;defaults to now()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Aug 2020 20:31:00 GMT</pubDate>
    <dc:creator>LeonardBarnhill</dc:creator>
    <dc:date>2020-08-24T20:31:00Z</dc:date>
    <item>
      <title>formatting time within a (decimal-date-time()) statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-time-within-a-decimal-date-time/m-p/721462#M626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am&amp;nbsp;developing in Survey123 Connect version 3.10.239.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to let a user know when the inspection of a structure is to be repeated. I start with a field ${currinspdate} that is by default now().&amp;nbsp; I give the user a choice of inspection frequency (i yr, 3 yr, 5 yr, and 10 yr) and I want the results to be in a traditional Mon dd, YYYY format.&amp;nbsp; The results are currently a number.&amp;nbsp; I have tried&amp;nbsp; date(decimal-date-time(formatDate)+365) formula and get a number but cannot get this in Mon dd, YYYY format.&amp;nbsp; &amp;nbsp; I have tried breaking it down to just date(decimal-date-time(now()+365) but get the same numeric results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a calculate type field with the calculation format-date(${currinspdate}, '%b %d, %Y"), then&amp;nbsp;trying the format date(decimal-date-time (${currinspdate} + 365). Error message "ReferenceError: formatDat"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is odd?&amp;nbsp; This formula worked in an older RC version using the entire formula:&lt;/P&gt;&lt;P&gt;if(${MONITOR}='1YR',date(decimal-date-time(now()+365),if(${MONITOR}='3YR',date(decimal-date-time(now())+1095),if(${MONITOR}='5YR',date(decimal-date-time(now())+1825),date(decimal-date-time(now())+3650))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attachment look toward the bottom for the section monattr&amp;nbsp; Next Inspection Schedule.&amp;nbsp; Todays Date is captured at the very beginning currinspdate&amp;nbsp;defaults to now()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2020 20:31:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/formatting-time-within-a-decimal-date-time/m-p/721462#M626</guid>
      <dc:creator>LeonardBarnhill</dc:creator>
      <dc:date>2020-08-24T20:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: formatting time within a (decimal-date-time()) statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-time-within-a-decimal-date-time/m-p/721463#M627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FIXED:&amp;nbsp; I guess I just needed to type it out to track what I had tried.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I inserted a new calculate type field named nextinspcalc between MONITOR and NEXTINSP and moved the long IF statement to the calculation column.&amp;nbsp; In the NEXTINSP calculation column, I added the formula format-date(${nextdatecalc}, '%b %d, %Y').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calculate type added on row 3 has been deleted since it was contributing nothing to the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now works like it did before.&amp;nbsp; I hope this helps someone else also&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2020 20:54:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/formatting-time-within-a-decimal-date-time/m-p/721463#M627</guid>
      <dc:creator>LeonardBarnhill</dc:creator>
      <dc:date>2020-08-24T20:54:20Z</dc:date>
    </item>
  </channel>
</rss>

