Ustaw warstwę startową i końcową

import arcpy
lyrFile = arcpy.mp.LayerFile(r'C:\Projects\Time\ShipPositions.lyrx')
for lyr in lyrFile.listLayers():
    if lyr.supports('TIME'):
        if lyr.isTimeEnabled:
            lyrTime = lyr.time
            startTime = lyrTime.startTime
            endTime = lyrTime.endTime
            timeDelta = endTime - startTime
            print(f"Layer: {lyr.name}")
            print(f"  Start Time: {str(startTime.strftime('%m-%d-%Y'))}")
            print(f"  End Time:   {str(endTime.strftime('%m-%d-%Y'))}")
            print(f"  Time Extent: {str(timeDelta.days)} days")
        else:
            print("No time properties have been set on the layer")
    else:
        print("Time is not supported on this layer")
Bohemian Unicorn