<?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 avHow to retrive the modification date of an ArcSDE elements? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739819#M57219</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I work with an arcSDE database (SQL server Enterprise geodatabase) and I want to retrive using python code the modification date of each of its elements (tables, features classes, rasters, ...)&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, 07 Aug 2015 13:11:26 GMT</pubDate>
    <dc:creator>SaidAkif</dc:creator>
    <dc:date>2015-08-07T13:11:26Z</dc:date>
    <item>
      <title>avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739819#M57219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I work with an arcSDE database (SQL server Enterprise geodatabase) and I want to retrive using python code the modification date of each of its elements (tables, features classes, rasters, ...)&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, 07 Aug 2015 13:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739819#M57219</guid>
      <dc:creator>SaidAkif</dc:creator>
      <dc:date>2015-08-07T13:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739820#M57220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Said, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say modified date, do you mean table structure or last updated/added row?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 14:36:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739820#M57220</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2015-08-07T14:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739821#M57221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Mean last feauture class modification or the date of creation&lt;/P&gt;&lt;P&gt;Thanks for your quick answer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 14:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739821#M57221</guid>
      <dc:creator>SaidAkif</dc:creator>
      <dc:date>2015-08-07T14:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739822#M57222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Said,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is something that can be done by sending SQL queries to your SDE repository tables to get the created UNIX time from the sde_table_registry and convert that to a more standard time. I have attached a script I have used to perform this in the past and write it out to a logfile. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this should be enough to get you started on how to access and convert the registration time in your Enterprise Geodatabase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, datetime, time
workPath = r"Database Connections\Connection to cwells.sde"
arcpy.CreateDatabaseView_management(workPath, viewName, "select database_name, owner, table_name, registration_date from sde.sde_table_registry")
for row in arcpy.SearchCursor(os.path.join(workPath, viewName)):
&amp;nbsp;&amp;nbsp;&amp;nbsp; tableName = row.getValue("DATABASE_NAME") + "." + row.getValue("OWNER") + "." + row.getValue("TABLE_NAME")
&amp;nbsp;&amp;nbsp;&amp;nbsp; cDate = row.getValue("REGISTRATION_DATE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; dTime = time.strftime('%d-%b-%Y %H:%M:%S', time.localtime(cDate))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:29:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739822#M57222</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2021-12-12T07:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739823#M57223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Is there a possibility to have just one date or the date creation or a last modification of a feature class instead of looping in all rows&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 15:33:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739823#M57223</guid>
      <dc:creator>SaidAkif</dc:creator>
      <dc:date>2015-08-07T15:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739824#M57224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure of your exact question, but are you asking if its possible to return a date for a single feature class only?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 15:35:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739824#M57224</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2015-08-07T15:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739825#M57225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some time you want to know the date when a feature classe was added to a dataset or when was its last modification. it is about those kind of information&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 17:34:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739825#M57225</guid>
      <dc:creator>SaidAkif</dc:creator>
      <dc:date>2015-08-07T17:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739826#M57226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample of a single feature class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, datetime, time
gdb = r"Database Connections\Connection to cwells.sde"
conn = arcpy.ArcSDESQLExecute(gdb)

owner = 'sde'
table = 'alex'

sql = """SELECT
create_date,modify_date
FROM sys.tables
where UPPER(SCHEMA_NAME(schema_id)) = '{0}' AND
&amp;nbsp; UPPER(OBJECT_NAME(object_id)) = '{1}'"""

dates = conn.execute(sql.format(owner.upper(), table.upper()))

print (owner + '.' + table).upper()
print "Create Date: {0}".format(dates[0][0])
print "Modify Date: {0}".format(dates[0][1])

OUTPUT

SDE.ALEX
Create Date: 8/3/2015 10:55:11 AM
Modify Date: 8/3/2015 11:00:51 AM&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:29:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739826#M57226</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2021-12-12T07:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739827#M57227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry but how can I try it with a single feature class&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 19:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739827#M57227</guid>
      <dc:creator>SaidAkif</dc:creator>
      <dc:date>2015-08-07T19:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739828#M57228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can change the "owner" and "table" variables to be your feature class, table or raster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if the feature class you want to get information for appears as "gis.abc.polygons" the variable would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;owner = 'abc'&lt;/P&gt;&lt;P&gt;table = 'polygons'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 21:16:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739828#M57228</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2015-08-07T21:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739829#M57229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. This is really helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 19:21:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739829#M57229</guid>
      <dc:creator>SaidAkif</dc:creator>
      <dc:date>2015-09-08T19:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739830#M57230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian&lt;BR /&gt;I tried your code before and it worked well. Not I got kind of error. Here is what I did:&lt;BR /&gt;gdb = r'Database Connections\GKMI.sde'&lt;BR /&gt;owner = 'sde'&amp;nbsp; I let it as sde&lt;BR /&gt;table='GKMIGeodatabase.ATLR.CH_ATL_PipingPlover"&amp;nbsp; hre is the name of my table or feature class&lt;/P&gt;&lt;P&gt;I run the script. Unfortunatly, the dates was just boolean and = True&lt;/P&gt;&lt;P&gt;I don't know what I did wrong?&lt;BR /&gt;Could you please give me more explanation on the owner and table variable significations?&lt;/P&gt;&lt;P&gt;Thankd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 14:12:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739830#M57230</guid>
      <dc:creator>SaidAkif</dc:creator>
      <dc:date>2015-10-01T14:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: avHow to retrive the modification date of an ArcSDE elements?</title>
      <link>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739831#M57231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I tried this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sql =&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #737300; font-size: 10pt;"&gt;"SELECT * FROM sys.tables"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737300; font-size: 10pt;"&gt;sde_return = sde_conn.execute(sql)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737300; font-size: 10pt;"&gt;after I retreive the first value of sde_return[&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737300; font-size: 10pt;"&gt;0] = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737300; font-size: 10pt;"&gt;[u'SDE_GEOMETRY3320', 223997, None, 45, 0, u'U ', u'USER_TABLE', u'20/03/2014 10:32:12 AM', u'27/09/2015 8:55:24 AM', 0, 0, 0, 1, None, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, u'TABLE', 0]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737300; font-size: 10pt;"&gt; Do you know please how can i get the signification of each value (field names of sys.tables)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737300; font-size: 10pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 17:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avhow-to-retrive-the-modification-date-of-an/m-p/739831#M57231</guid>
      <dc:creator>SaidAkif</dc:creator>
      <dc:date>2015-10-01T17:22:04Z</dc:date>
    </item>
  </channel>
</rss>

