How do I get the time a file was last modified in Python? [duplicate] February 25, 2023 by Tarik >>> import os >>> f = os.path.getmtime('test1.jpg') >>> f 1223995325.0 since the beginning of (epoch)