I am automating backups at work for individuals, but the compressed file is coming up with the date that the backup folder was created, and not the date when the feature class was created.
folder_path = input("Please enter the file location to store the backups: ")
num_items = int(input("How many items do you want to back up? "))
query_string = "type:Feature Service, owner:{}".format(username)
items = gis.content.search(query=query_string, max_items=num_items, sort_field='modifed', sort_order='desc')
print(str(len(items)) + " items will be backed up to " + folder_path +". See the list below:")
items
created_timestamp = os.path.getctime(folder_path)
print (datetime.datetime.fromtimestamp(created_timestamp))
When i put "str(items)" instead of "folder_path" (because it said items can't be a list, it has to be a string) it tells me:
The system cannot find the path specified
So does anybody know how to modify this code in order to get the creation date for the feature class?