The code I've written so far is included below. I am under the
impression that assigning a variable to
datetime.datetime.fromtimestamp() will result in a list, so I created
my Python code like below. I want my function to return the time
that I first created my file as a substring of a string in the format
"yyyy-mm-dd". I would greatly appreciate any help in making this code work correctly.

```
import os
import datetime

def file_date(filename):
  # Create the file in the current directory
  with open(filename, "x") as file1:
    pass
  timestamp = os.path.getmtime(file1)
  # Convert the timestamp into a readable format, then into a string
  list1 = datetime.datetime.fromtimestamp(timestamp)
  str1 = "-".join(list1)
  # Return just the date portion 
  # Hint: how many characters are in “yyyy-mm-dd”? 
  return ("{str1[0:9]}".format(str1)

print(file_date("newfile.txt")) 
# Should be today's date in the format of yyyy-mm-dd

```