<?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: File geodatabase creation date in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94292#M7365</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I do is inspect every file in the GDB, look at the time stamp, adjust for daylight saving to get UTC and go with that. You'll need to go deep depending on your workflow.&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sent from my Lumia 830&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 May 2016 00:54:28 GMT</pubDate>
    <dc:creator>BruceHarold</dc:creator>
    <dc:date>2016-05-21T00:54:28Z</dc:date>
    <item>
      <title>File geodatabase creation date</title>
      <link>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94289#M7362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to get the date a file geodatabase was created? Windows file explorer properties shows the correct creation date but &lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;A href="https://docs.python.org/2/library/os.path.html#os.path.getctime"&gt;os.path.getctime()&lt;/A&gt;​&lt;/SPAN&gt; just seems to return the same thing as &lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;A href="https://docs.python.org/2/library/os.path.html#os.path.getmtime"&gt;os.path.getmtime()&lt;/A&gt;​&lt;/SPAN&gt;: the date modified ( which gets changed every time you view something in the gdb). &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/workspace-properties.htm"&gt;Workspace Describe&lt;/A&gt; doesn't have anything either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2016 21:11:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94289#M7362</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2016-05-20T21:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: File geodatabase creation date</title>
      <link>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94290#M7363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;never checked it... but are you saying that the path to *.gdb is being treated like a file? because folders don't change time when their contents change... now I will have to check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2016 21:17:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94290#M7363</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-20T21:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: File geodatabase creation date</title>
      <link>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94291#M7364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just noticed there is a &lt;SPAN style="font-family: 'courier new', courier;"&gt;gdb&lt;/SPAN&gt; file in the geodatabase that seems to retain the earliest time of the geodatabase. I'm going with that unless anyone else has a better suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2016 23:24:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94291#M7364</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2016-05-20T23:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: File geodatabase creation date</title>
      <link>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94292#M7365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I do is inspect every file in the GDB, look at the time stamp, adjust for daylight saving to get UTC and go with that. You'll need to go deep depending on your workflow.&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sent from my Lumia 830&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 May 2016 00:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94292#M7365</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2016-05-21T00:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: File geodatabase creation date</title>
      <link>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94293#M7366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a function to get that creation date by finding the minimum file date.&lt;/P&gt;&lt;P&gt;This function will work on any "folder" dataset like .gdb, grid, coverage, as it returns the earliest creation date of all files in the folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def create_date(gdb):
&amp;nbsp; import os
&amp;nbsp; import time
&amp;nbsp; import glob
&amp;nbsp;&amp;nbsp;&amp;nbsp; first_time = min([os.path.getctime(f) for f in glob.glob(gdb + "/*")])
&amp;nbsp;&amp;nbsp;&amp;nbsp; # return the time
&amp;nbsp;&amp;nbsp;&amp;nbsp; t = time.localtime(&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;first_time&lt;/SPAN&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # or a string
&amp;nbsp;&amp;nbsp;&amp;nbsp; t = time.strftime("%c", time.localtime(&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;first_time&lt;/SPAN&gt;))
&amp;nbsp;&amp;nbsp;&amp;nbsp; return t&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:36:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94293#M7366</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T23:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: File geodatabase creation date</title>
      <link>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94294#M7367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give an example where Windows Explorer gives different creation and modification dates but Python returns the same date for both?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running ArcMap 10.4 (Python 2.7.10) on Windows 7 x64 Enterprise Edition, and Python returns the same dates as Windows Explorer:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="windows_explorer_default_gdb_dates.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/201707_windows_explorer_default_gdb_dates.PNG" style="height: auto; left-margin: 60px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; from time import ctime
&amp;gt;&amp;gt;&amp;gt; from os.path import getmtime, getctime, split
&amp;gt;&amp;gt;&amp;gt; gdb = # path to file geodatabase
&amp;gt;&amp;gt;&amp;gt; print "{}\t{}\t{}".format(split(gdb)[1],
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctime(getmtime(gdb)),
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctime(getctime(gdb)))
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&lt;SPAN style="font-family: Consolas;"&gt;Default.gdb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sat May 21 10:45:21 2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wed Feb 10 08:43:54 2016&lt;/SPAN&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:36:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94294#M7367</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-10T23:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: File geodatabase creation date</title>
      <link>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94295#M7368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried your code, Joshua, and it seems to work fine. I'm not sure what I was doing; I must have had a brief infection of Friday afternoon derp derp. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;However, since I'm already using &lt;SPAN style="font-family: 'courier new', courier;"&gt;datetime&lt;/SPAN&gt;, I'll use that instead of &lt;SPAN style="font-family: 'courier new', courier;"&gt;time&lt;/SPAN&gt;.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import datetime
import os

gdb = # path to file geodatabase
created_timestamp = os.path.getctime(gdb)
print datetime.datetime.fromtimestamp(created_timestamp)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:36:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/file-geodatabase-creation-date/m-p/94295#M7368</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-10T23:36:27Z</dc:date>
    </item>
  </channel>
</rss>

