<?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: Python script tool set input Date parameter to Date format by default in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-tool-set-input-date-parameter-to/m-p/1330348#M68690</link>
    <description>&lt;P&gt;I did this (inspired by the link you provided) and it works okay:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def updateParameters(self, parameters):
        if parameters[1].altered:
            parameters[1].value = datetime.datetime.combine(parameters[1].value, datetime.time())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What ends up happening is that, at &lt;EM&gt;first&lt;/EM&gt;, the "Date and Time" option is selected.&amp;nbsp; Maybe that can't be helped.&amp;nbsp; But once the user &lt;EM&gt;closes&lt;/EM&gt; the drop-down calendar, the time is stripped off in the edit control, and the next time they click the clock button, the "Date" option &lt;EM&gt;is&lt;/EM&gt; selected.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2023 19:12:20 GMT</pubDate>
    <dc:creator>RogerDunnGIS</dc:creator>
    <dc:date>2023-09-19T19:12:20Z</dc:date>
    <item>
      <title>Python script tool set input Date parameter to Date format by default</title>
      <link>https://community.esri.com/t5/python-questions/python-script-tool-set-input-date-parameter-to/m-p/1306305#M68105</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/arcpy-script-tool-format-parameter-date-data-type/td-p/489908" target="_blank" rel="noopener"&gt;This post&lt;/A&gt; gets really close to what I'm trying to do, but I can't quite figure out how to implement. Had anyone figured out how to set the default type on a Date input parameter to Date instead of the default Date and Time radio button?&lt;/P&gt;&lt;P&gt;I did test the option of setting a default value on the parameter to be a date (e.g. 1/1/2023), and that works, but I'd rather not do if we can just get at that radion button setting directly instead.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 18:07:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-tool-set-input-date-parameter-to/m-p/1306305#M68105</guid>
      <dc:creator>JohnNergeBrooklynPark</dc:creator>
      <dc:date>2023-07-06T18:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Python script tool set input Date parameter to Date format by default</title>
      <link>https://community.esri.com/t5/python-questions/python-script-tool-set-input-date-parameter-to/m-p/1330348#M68690</link>
      <description>&lt;P&gt;I did this (inspired by the link you provided) and it works okay:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def updateParameters(self, parameters):
        if parameters[1].altered:
            parameters[1].value = datetime.datetime.combine(parameters[1].value, datetime.time())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What ends up happening is that, at &lt;EM&gt;first&lt;/EM&gt;, the "Date and Time" option is selected.&amp;nbsp; Maybe that can't be helped.&amp;nbsp; But once the user &lt;EM&gt;closes&lt;/EM&gt; the drop-down calendar, the time is stripped off in the edit control, and the next time they click the clock button, the "Date" option &lt;EM&gt;is&lt;/EM&gt; selected.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 19:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-tool-set-input-date-parameter-to/m-p/1330348#M68690</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2023-09-19T19:12:20Z</dc:date>
    </item>
  </channel>
</rss>

