I am having an issue trying to change to a historical version on an SDE feature class using Python and arcpy.ChangeVersion_management.
I am able to manually change the version to a specific date and time using ArcMap. I am also able to fully automate the process using ModelBuilder.
When I export the ModelBuilder model to a python script the script runs without error but the version that is selected is the historical version with todays date and not the date selected as the date parameter.
Using Arcmap and the Python window (Geoprocessing -> Python) I can also run the python code without error and the result is the same. The historical layer is selected with the current date and not the date selected as the date parameter.
Here is the Python syntax I am executing:
arcpy.ChangeVersion_management("Parcels", "HISTORICAL", "", "7/1/2013 4:30:00 PM")
I also get the same results using:
historyDate = datetime.datetime(2011, 7, 1)
arcpy.ChangeVersion_management("Parcels", "HISTORICAL", "", historyDate)
while the following throws a RuntimeError:
historyDate = datetime.date(2011, 7, 1)
arcpy.ChangeVersion_management("Parcel", "HISTORICAL", "", historyDate)
Is this a known bug or am I just going about this the wrong way?