python get file creation time

To get file creation time python offers getctime() function which returns the number of seconds since the epoch. The function works both in Python2.7 and Python3+

Here is Python3 format example:

import os.path, time
print("File creation date and time: {:s}".format(time.ctime(os.path.getctime("mytestfile.txt"))))
  • More information:

How to convert epoc time to human readable format.

  • DONE!


  • Minimum Requirements and How-to:

  • Python3

Leave a Reply