Beispiel #1
0
 def _created(self, path: Path) -> pendulum.DateTime:
     # see https://stackoverflow.com/a/39501288/300783
     stat = path.stat()
     time = 0  # type: SupportsFloat
     if sys.platform.startswith("win"):
         time = stat.st_ctime
     else:
         try:
             time = stat.st_birthtime
         except AttributeError:
             # We're probably on Linux. No easy way to get creation dates here,
             # so we'll settle for when its content was last modified.
             time = stat.st_mtime
     return pendulum.from_timestamp(float(time))
Beispiel #2
0
 def _last_modified(self, path: Path) -> pendulum.DateTime:
     return pendulum.from_timestamp(float(path.stat().st_mtime))
Beispiel #3
0
 def _last_modified(self, path: Path) -> datetime:
     return datetime.fromtimestamp(path.stat().st_mtime)