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))
def _last_modified(self, path: Path) -> pendulum.DateTime: return pendulum.from_timestamp(float(path.stat().st_mtime))
def _last_modified(self, path: Path) -> datetime: return datetime.fromtimestamp(path.stat().st_mtime)