The number you are getting is a timestamp in Unix format. It represents the number of seconds since the start of the year 1970 in UTC (that's why it's so big).
In order to convert it to something more usable, you can use datetime.fromtimestamp():
from datetime import datetime
filename = "testFile1.txt"
file_stat = os.stat(filename)
last_modification = datetime.fromtimestamp(file_stat.st_mtime)
last_access = datetime.fromtimestamp(file_stat.st_atime)
The time you are getting here is not "since the last change". In order to get the amount of time that has passed since a modification or access, you'll need to subtract the modification / access time from the current time:
current_time = datetime.now()
time_since_last_modification = current_time - last_modification
time_since_last_access = current_time - last_access
The code above results in two timedelta objects. In your application, you will need to convert those to days, which is trivial:
days_since_last_modification = time_since_last_modification.days
days_since_last_access = time_since_last_access.days
Whole code
To summarize, this code:
from datetime import datetime
filename = "testFile1.txt"
file_stat = os.stat(filename)
last_modification = datetime.fromtimestamp(file_stat.st_mtime)
last_access = datetime.fromtimestamp(file_stat.st_atime)
current_time = datetime.now()
time_since_last_modification = current_time - last_modification
time_since_last_access = current_time - last_access
days_since_last_modification = time_since_last_modification.days
days_since_last_access = time_since_last_access.days
msg = "{} was modified {} days ago, with last access {} days ago"
msg = msg.format(filename, days_since_last_modification,
days_since_last_access)
print(msg)
Will output something along the lines:
testFile1.txt was modified 4 days ago, last access was 2 days ago