3

For ordinary shapefiles located on a disk, I know I can check the date modified using os.stat (see Creating table containing all filenames (and possibly metadata) in File Geodatabase?), but how would I do so if I want to know the date modified for a feature class WITHIN a file geodatabase?

Specifically via ArcPy in ArcGIS Desktop 10.2.

There are some XML based methods (Determining date or time Feature Class was created in File Geodatabase? and How do I find out when a shapefile was created?) but they seem a bit overkill just to get some basic metadata out.

Basic code:

import arcpy
gdbDir=r"D:\path\to\Default.gdb"
arcpy.env.workspace = gdbDir

fcList = arcpy.ListFeatureClasses()
for fc in fclist:
    pass
    #code to extract feature class's date modified goes here
7
  • 2
    Probably also overkill as it tracks every feature, but have you considered Editor Tracking? See About tracking an editor's changes to data
    – Midavalo
    Commented Oct 4, 2016 at 21:10
  • 2
    See this old post on Geonet - Date Modified / Created for feature class in file geodatabase? - it sounds like it may not be possible in arcpy unless it's been added in the last couple of releases (I doubt it has been).
    – Midavalo
    Commented Oct 4, 2016 at 21:19
  • @Midavalo That editor tracking looks interesting. I'll try going along that route for now, but for my use case, I only really need the last date modified since I'd like to know if I should overwrite the featureclass (if it was last updated a month ago).
    – weiji14
    Commented Oct 4, 2016 at 21:20
  • 1
    I found a Python solution over at geonet but it looks like it will not work in a CITRIX environment geonet.esri.com/thread/74409.
    – GBG
    Commented Oct 5, 2016 at 20:04
  • 1
    @GBG which post on that thread contains your solution?
    – Midavalo
    Commented Oct 5, 2016 at 20:43

0