<?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 Python Date Stamping (continued) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-date-stamping-continued/m-p/735#M91</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I am having a hard time exporting table to excel while time or date stamping the .xls file. Right now my py scrips runs through its steps and exports an excel file. I'd like the excel file name to by appended with the current date (or time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just can't seem to append the variable to the output filename in the following line.&amp;nbsp; &lt;CODE&gt;&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;TableToExcel_conversion&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;in_table&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;out_xls&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Jan 2015 16:13:41 GMT</pubDate>
    <dc:creator>xanderm</dc:creator>
    <dc:date>2015-01-23T16:13:41Z</dc:date>
    <item>
      <title>Python Date Stamping (continued)</title>
      <link>https://community.esri.com/t5/python-questions/python-date-stamping-continued/m-p/735#M91</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I am having a hard time exporting table to excel while time or date stamping the .xls file. Right now my py scrips runs through its steps and exports an excel file. I'd like the excel file name to by appended with the current date (or time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just can't seem to append the variable to the output filename in the following line.&amp;nbsp; &lt;CODE&gt;&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;TableToExcel_conversion&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;in_table&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;out_xls&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 16:13:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-date-stamping-continued/m-p/735#M91</guid>
      <dc:creator>xanderm</dc:creator>
      <dc:date>2015-01-23T16:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python Date Stamping (continued)</title>
      <link>https://community.esri.com/t5/python-questions/python-date-stamping-continued/m-p/736#M92</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To show you more or less how you can do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
import datetime

currentdate = datetime.date.today()
print currentdate

out_name = "C:\\Users\\xander_mavrides\\Desktop\\DAILY ESO_Moratorium_List.xls"
xls_path, xls_fullname = os.path.split(out_name)
print "xls_path&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {0}".format(xls_path)
print "xls_fullname&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {0}".format(xls_fullname)

xls_name, xls_ext = os.path.splitext(xls_fullname)
print "xls_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {0}".format(xls_name)
print "xls_ext&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {0}".format(xls_ext)

new_xls_fullname = "{0}_{1}{2}".format(xls_name, currentdate, xls_ext)
print "new_xls_fullname : {0}".format(new_xls_fullname)

new_xls_filepath = os.path.join(xls_path, new_xls_fullname)
print "new_xls_filepath : {0}".format(new_xls_filepath)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;returns:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;2015-01-23&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;xls_path&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : C:\Users\xander_mavrides\Desktop&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;xls_fullname&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : DAILY ESO_Moratorium_List.xls&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;xls_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : DAILY ESO_Moratorium_List&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;xls_ext&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : .xls&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;new_xls_fullname : DAILY ESO_Moratorium_List_2015-01-23.xls&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;new_xls_filepath : &lt;STRONG&gt;C:\Users\xander_mavrides\Desktop\DAILY ESO_Moratorium_List_2015-01-23.xls&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 19:55:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-date-stamping-continued/m-p/736#M92</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T19:55:44Z</dc:date>
    </item>
  </channel>
</rss>

