<?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: Why won't my Date Variable work? in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823756#M304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! I see where I went wrong. I just copied and pasted the expression Curits provided which was missing a bracket and I didn't notice. Worked perfectly the second time using your's Dan. Thank you both for your help!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Nov 2017 00:26:29 GMT</pubDate>
    <dc:creator>LindsayRaabe_FPCWA</dc:creator>
    <dc:date>2017-11-16T00:26:29Z</dc:date>
    <item>
      <title>Why won't my Date Variable work?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823752#M300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I seem to be having&amp;nbsp; issues getting a&amp;nbsp;String variable to work. I am attempting to get a Date (formatted as YYYYMMDD) in a String Variable which then gets used as a part of an export filename. I was getting&amp;nbsp;a "1" output instead of the Date originally (and other errors) but now I am managing to get the date but also keep getting errors about incorrect naming. Can anyone tell me what is wrong? The original demo tool I used to figure this out so far (provided &lt;A _jive_internal="true" href="https://community.esri.com/thread/21496"&gt;here&lt;/A&gt;)&amp;nbsp;has the same issue!&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;IMG __jive_id="382726" class="image-3 jive-image" height="900" src="https://community.esri.com/legacyfs/online/382726_pastedImage_5.png" style="border: 0px; font-weight: inherit; font-size: 14px; margin: 10px 10px 10px 0px;" width="830" /&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;IMG __jive_id="382739" class="image-2 jive-image" height="550" src="https://community.esri.com/legacyfs/online/382739_pastedImage_4.png" style="border: 0px; font-weight: inherit; font-size: 14px; margin: 10px 10px 10px 0px;" width="637" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 08:27:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823752#M300</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2017-11-07T08:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why won't my Date Variable work?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823753#M301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot reproduce your issue @ 10.5.1.&amp;nbsp; But: percent signs are significant to ModelBuilder as they delimit ModelBuilder variables. If you have a variable "d" or "m" in your model I could see that breaking things, or maybe you are using a different version of ArcGIS where the parser isn't as smart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may be able to avoid this issue by hiding percent signs in your time code&amp;nbsp;string like this using the Python chr() function and string formatting:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strftime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"zzz{0}d{0}m{0}Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;chr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;37&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Update&lt;/EM&gt;: This is a Calculate Value expression you can use instead of what you're using, which hides the "%" from Model Builder. The strftime function will see this: "zzz%d%m%Y" (the expression chr(37) is equal to "%", which I then substituted in to the expression using the .format() method.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2017 16:35:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823753#M301</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-11-10T16:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why won't my Date Variable work?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823754#M302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a copy of the tool I've been testing this in. Not quite sure how to use the script you provided (pretty much a Python novice). We too are using 10.5.1 and there is only the one variable in the tool.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 01:54:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823754#M302</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2017-11-13T01:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why won't my Date Variable work?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823755#M303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Curtis is suggestion that you use the expression that he posted above in your field calculator expression rather than hardcoding the % symbols.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use python 3.5 so I am not sure what he is expecting as output, but here is what I get&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strftime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;u&lt;SPAN class="string token"&gt;"zzz{0}d{0}m{0}Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;chr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;37&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'zzz12112017'&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# which appears to be day, month and year of today&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:47:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823755#M303</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T09:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why won't my Date Variable work?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823756#M304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! I see where I went wrong. I just copied and pasted the expression Curits provided which was missing a bracket and I didn't notice. Worked perfectly the second time using your's Dan. Thank you both for your help!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 00:26:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823756#M304</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2017-11-16T00:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why won't my Date Variable work?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823757#M305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mr. Patterson,&lt;/P&gt;&lt;P&gt;your expression helped me but in the end i got table.xls with output name like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/453309_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what else can i do to get output name like the "green bubble" output_value is showing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jul 2019 12:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823757#M305</guid>
      <dc:creator>StanislavaV</dc:creator>
      <dc:date>2019-07-17T12:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why won't my Date Variable work?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823758#M306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Open the bubble and enter: %output_value%. The text will be substituted there. Though,&amp;nbsp;you need to provide a folder variable as well so you can give a full path:&lt;/P&gt;&lt;P&gt;%output folder%\%output_value%&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2019 14:56:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/823758#M306</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2019-07-19T14:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why won't my Date Variable work?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/1135043#M307</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;&lt;BR /&gt;I am having problem to add date to my file&lt;BR /&gt;&lt;BR /&gt;I am getting this error in ArcPro&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ARM_6-1642611411886.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31818iE9632E4A7AC4CACB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ARM_6-1642611411886.png" alt="ARM_6-1642611411886.png" /&gt;&lt;/span&gt;&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="ARM_5-1642611336251.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31817i7089D48AC52F7F5E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ARM_5-1642611336251.png" alt="ARM_5-1642611336251.png" /&gt;&lt;/span&gt;&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="ARM_0-1642611092230.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31812i7458A62E0C5CB135/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ARM_0-1642611092230.png" alt="ARM_0-1642611092230.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am having problem to set copy features output. I tried with code here too&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 16:58:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/why-won-t-my-date-variable-work/m-p/1135043#M307</guid>
      <dc:creator>anonymous55</dc:creator>
      <dc:date>2022-01-19T16:58:36Z</dc:date>
    </item>
  </channel>
</rss>

