Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

set layer start and end time arcpy

import arcpy
lyrFile = arcpy.mp.LayerFile(r'C:ProjectsTimeShipPositions.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")
Comment

PREVIOUS NEXT
Code Example
Python :: Book.__init__() missing 5 required positional arguments 
Python :: convert depth image to point cloud 
Python :: compresser fichier pyhton 
Python :: get list values in b/w indexes python 
Python :: sorting list of strings by length python 
Python :: How to make colors.winapp in WindowsAP 
Python :: stacked percentage bar chart 
Python :: django query filter less than 
Python :: rich import in python 
Python :: Creating a bag-of-words in scikit-learn 
Python :: dht22 micropython library 
Python :: function for getting the basic statistic of our Dataframe in one go 
Python :: Understand the most appropriate graph to use for your dataset visualization 
Python :: pyaudio get system audio 
Python :: scaling, cross validation and fitting a model through a pipline 
Python :: 1045 - Triangle Types 
Python :: tuples of unique rows pandas 
Python :: Problème determinant algebre lineaire pdf mpsi 
Python :: asdfghjkl 
Python :: get_string python 
Python :: accessing element from csv file in python 
Python :: python generator cheat sheet download 
Python :: is python3 enough for react native 
Python :: python output parameter 
Python :: pop function second argument in python 
Python :: not en python 
Python :: tuto date and time python 
Python :: one small letter three big bodyguard 
Python :: access data frame element by loc 
Python :: install iris 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =