public function getLastModified(string $path) : DateTime
    {
        if (!$this->exists($path)) {
            throw new FileSystemException("File at path $path not found");
        }

        $modifiedTimestamp = filemtime($path);

        if ($modifiedTimestamp === false) {
            throw new FileSystemException("Failed to get last modified time of $path");
        }

        $modifiedDateTime = DateTime::createFromFormat('U', $modifiedTimestamp);

        if ($modifiedDateTime === false) {
            throw new FileSystemException('Failed to convert last modified time to DateTime object');
        }

        return $modifiedDateTime;
    }