<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filesystem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'function.filemtime.php',
    1 => 'filemtime',
    2 => 'Obt&eacute;m o hor&aacute;rio de modifica&ccedil;&atilde;o do arquivo',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Fun&ccedil;&otilde;es de Filesystem',
  ),
  'prev' => 
  array (
    0 => 'function.fileinode.php',
    1 => 'fileinode',
  ),
  'next' => 
  array (
    0 => 'function.fileowner.php',
    1 => 'fileowner',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'pt_BR',
    'path' => 'reference/filesystem/functions/filemtime.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.filemtime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">filemtime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">filemtime</span> &mdash; <span class="dc-title">Obtém o horário de modificação do arquivo</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.filemtime-description">
  <h3 class="title">Descrição</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>filemtime</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Esta função retorna o horário em que os blocos de dados de um arquivo estavam sendo
   escritos, isto é, o horário em que o conteúdo do arquivo foi modificado.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.filemtime-parameters">
  <h3 class="title">Parâmetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Caminho para o arquivo.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.filemtime-returnvalues">
  <h3 class="title">Valor Retornado</h3>
  <p class="para">
   Retorna o horário em que o arquivo foi modificado pela última vez,  ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> em caso de falha.
   O horário é retornado como um timestamp Unix, que é
   adequado para a função <span class="function"><a href="function.date.php" class="function">date()</a></span>.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.filemtime-errors">
  <h3 class="title">Erros/Exceções</h3>
  <p class="para">
Em caso de falha, um <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> será emitido.
</p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.filemtime-examples">
  <h3 class="title">Exemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemplo #1 Exemplo de <span class="function"><strong>filemtime()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// exibe algo como: arquivo.txt foi modificado em December 29 2002 22:16:23.<br /><br /></span><span style="color: #0000BB">$filename </span><span style="color: #007700">= </span><span style="color: #DD0000">'arquivo.txt'</span><span style="color: #007700">;<br />if (</span><span style="color: #0000BB">file_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$filename</span><span style="color: #DD0000"> foi modificado em " </span><span style="color: #007700">. </span><span style="color: #0000BB">date </span><span style="color: #007700">(</span><span style="color: #DD0000">"F d Y H:i:s."</span><span style="color: #007700">, </span><span style="color: #0000BB">filemtime</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">));<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.filemtime-notes">
  <h3 class="title">Notas</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: <p class="para">Note que a resolução de tempo pode variar
de um sistema de arquivos para outro.</p></p></blockquote>
  <blockquote class="note"><p><strong class="note">Nota</strong>: <span class="simpara">Os resultados desta
função são armazenados em cache. Consulte a função <span class="function"><a href="function.clearstatcache.php" class="function">clearstatcache()</a></span> para
mais detalhes.</span></p></blockquote>
  <div class="tip"><strong class="tip">Dica</strong><p class="simpara">A partir do PHP 5.0.0, esta função
também pode ser usada com <em>alguns</em> empacotadores de URL. Consulte os
<a href="wrappers.php" class="xref">Protocolos e empacotadores suportados</a> para determinar quais empacotadores suportam
a família de funções <span class="function"><a href="function.stat.php" class="function">stat()</a></span>.</p></div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.filemtime-seealso">
  <h3 class="title">Veja Também</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.filectime.php" class="function" rel="rdfs-seeAlso">filectime()</a> - Obt&eacute;m o hor&aacute;rio de modifica&ccedil;&atilde;o de inode do arquivo</span></li>
    <li><span class="function"><a href="function.stat.php" class="function" rel="rdfs-seeAlso">stat()</a> - Obt&eacute;m informa&ccedil;&otilde;es sobre um arquivo</span></li>
    <li><span class="function"><a href="function.touch.php" class="function" rel="rdfs-seeAlso">touch()</a> - Define hor&aacute;rio de acesso e de modifica&ccedil;&atilde;o de arquivo</span></li>
    <li><span class="function"><a href="function.getlastmod.php" class="function" rel="rdfs-seeAlso">getlastmod()</a> - Obt&eacute;m o hor&aacute;rio da &uacute;ltima modifica&ccedil;&atilde;o na p&aacute;gina</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>