Gets the last modified time

@param string $path The path to check
@return DateTime The last modified time
@throws FileSystemException Thrown if the file was not found or if the modified time was not readable
172683
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;
    }
301707
public static function modTime($path) 
    { 
        $time       = filemtime($path);
        $isDst      = (date('I', $time) == 1);
        $system_dst = (date('I') == 1);
        $adjustment = 0;
        
        if ($isDst == false && $system_dst == true) {
            $adjustment = 3600;
        } elseif ($isDst == true && $system_dst == false) {
            $adjustment = -3600;
        } else {
            $adjustment = 0;
        }

        return ($time + $adjustment);
    }
25466
public function getLastRead(): \DateTime
    {
        if ($this->caching == false) {
            return \DateTime::createFromFormat("F d Y H:i:s.", date("F d Y H:i:s.", fileatime($this->getAbsoluteFilePath())));
        }

        if ($this->lastRead == null) {
            $this->lastRead = \DateTime::createFromFormat("F d Y H:i:s.", date("F d Y H:i:s.", fileatime($this->getAbsoluteFilePath())));
        }

        return $this->lastRead;
    }
933718
public static function getDate($path)
    {
        if ($path[0] != "/") {
            $path = Env::path($path, Env::PATH_DOCUMENT_ROOT);
        }

        if (!$exif = exif_read_data($path)) {
            return;
        }

        if (empty($exif["DateTime"])) {
            return;
        }

        if (!$date = strtotime($exif["DateTime"])) {
            return;
        }

        return $date;
    }
902769
public long getLastModified(String path)
  {
    try {
      // this entry time can cause problems ...
      ZipEntry entry = getZipEntry(path);

      return entry != null ? entry.getTime() : -1;
    } catch (IOException e) {
      log.log(Level.FINE, e.toString(), e);
    }

    return  -1;
  }
1245344
public function isExpired( $path )
	{
		$compiled = $this->getCompiledPath( $path );

		// If the compiled file doesn't exist we will indicate that the view is expired
		// so that it can be re-compiled. Else, we will verify the last modification
		// of the views is less than the modification times of the compiled views.
		if ( !$this->files->exists( $compiled ) )
		{
			return true;
		}

		$lastModified = $this->files->lastModified( $path );

		return $lastModified >= $this->files->lastModified( $compiled );
	}
1222198
public function getExtension(string $path) : string
    {
        if (!$this->exists($path)) {
            throw new FileSystemException("File at path $path not found");
        }

        return pathinfo($path, PATHINFO_EXTENSION);
    }
581022
def get_modification_datetime(filepath):
    
    import tzlocal
    timezone = tzlocal.get_localzone()
    mtime = datetime.fromtimestamp(os.path.getmtime(filepath))
    return mtime.replace(tzinfo=timezone)
1294559
public function getLastUpdate()
    {
        $time = filemtime($this->parser->getFile());
        if ($time === false) {
            return new DataBackendException(
                "Could not read modification time from {$this->parser->getFile()}"
            );

        }
        return $time;
    }
1179553
public function isExpired($path)
    {
        $time = filemtime($this->getCompiledPath($path));

        return $this->twig->isTemplateFresh($path, $time);
    }
645194
public function isExpired($path)
    {
        $compiled = $this->getCompiledPath($path);

        // If the compiled file doesn't exist we will indicate that the view is expired
        // so that it can be re-compiled. Else, we will verify the last modification
        // of the views is less than the modification times of the compiled views.
        if (! $this->cachePath || ! $this->files->exists($compiled)) {
            return true;
        }

        $viewLastModified = $this->loader->lastModified($path);
        #Log::debug(__CLASS__ . ':' . __TRAIT__ . ':' . __FILE__ . ':' . __LINE__ . ':' . __FUNCTION__ . ':' .
        #    'Checking isExpired for ' . $path . ' which is ' . $viewLastModified
        #);

        $compiledLastModified = $this->files->lastModified($compiled);
        #Log::debug(__CLASS__ . ':' . __TRAIT__ . ':' . __FILE__ . ':' . __LINE__ . ':' . __FUNCTION__ . ':' .
        #    'Checking against compiled path ' . $compiled . ' which has last modified timestamp ' .
        #    $compiledLastModified
        #);

        return $viewLastModified >= $compiledLastModified;
    }
469923
public function getFileName(string $path) : string
    {
        if (!$this->exists($path)) {
            throw new FileSystemException("File at path $path not found");
        }

        return pathinfo($path, PATHINFO_FILENAME);
    }
867161
public function getUploadedFile($path)
    {
        $file = Hash::get($this->uploadedFiles, $path);
        if (!$file instanceof UploadedFile) {
            return null;
        }

        return $file;
    }
1256268
public function getLastModifiedTime(PhingFile $f)
    {
        if (!$f->exists()) {
            return 0;
        }

        @clearstatcache();
        $strPath = (string) $f->getPath();

        if (@is_link($strPath)) {
            $stats = @lstat($strPath);

            if (!isset($stats['mtime'])) {
                $mtime = false;
            } else {
                $mtime = $stats['mtime'];
            }
        } else {
            $mtime = @filemtime($strPath);
        }

        if (false === $mtime) {
            $msg = "FileSystem::getLastModifiedTime() FAILED. Can not get modified time of $strPath. $php_errormsg";
            throw new IOException($msg);
        }

        return (int) $mtime;
    }
477906
public function atime(string $path): Promise
    {
        if (!@\file_exists($path)) {
            return new Failure(new FilesystemException(
                "Path does not exist"
            ));
        }
        $atime = @\fileatime($path);
        \clearstatcache(true, $path);

        return new Success($atime);
    }
653333
public static function getFileMimeByCmd($path)
    {
        if (empty($path) || ! is_file($path)) {
            return null;
        }
        
        $info = exec('file -ib "' . $path . '"');
        list ($type, $temp) = explode(';', $info);
        return $type;
    }
629138
private function tryReadFile($path) {
        if (!file_exists($path)) {
            return false;
        }

        $interval = 100000;
        $totalTime = 0;

        while (($result = file_get_contents($path)) === false) {
            if ($totalTime >= $this->accessTime) {
                return false;
            }

            usleep($interval);

            $totalTime += $interval;
        }

        return $result;
    }