<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.datetime.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'function.strftime.php',
    1 => 'strftime',
    2 => 'Formata uma data/hor&aacute;rio de acordo com as configura&ccedil;&otilde;es locais',
  ),
  'up' => 
  array (
    0 => 'ref.datetime.php',
    1 => 'Fun&ccedil;&otilde;es de Data/Hor&aacute;rio',
  ),
  'prev' => 
  array (
    0 => 'function.mktime.php',
    1 => 'mktime',
  ),
  'next' => 
  array (
    0 => 'function.strptime.php',
    1 => 'strptime',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'pt_BR',
    'path' => 'reference/datetime/functions/strftime.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.strftime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">strftime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">strftime</span> &mdash; <span class="dc-title">Formata uma data/horário de acordo com as configurações locais</span></p>

 </div>

 <div id="function.strftime-refsynopsisdiv">
  <div class="warning"><strong class="warning">Aviso</strong><p class="simpara">Esta função foi
<em>DESCONTINUADA</em> a partir do PHP 8.1.0. O uso desta função
é fortemente desencorajado.</p></div>
<p class="para">
 Alternativas a esta função incluem:
</p>

  <ul class="simplelist">
   <li><span class="function"><a href="function.date.php" class="function">date()</a></span></li>
   <li><span class="methodname"><a href="intldateformatter.format.php" class="methodname">IntlDateFormatter::format()</a></span></li>
  </ul>
 </div>

 <div class="refsect1 description" id="refsect1-function.strftime-description">
  <h3 class="title">Descrição</h3>
  <div class="methodsynopsis dc-description">
   <span class="attribute"><a href="class.deprecated.php">#[\Deprecated]</a> </span><br>
   <span class="methodname"><strong>strftime</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$format</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$timestamp</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Formata uma data/horário local de acordo com a configuração do idioma. Nome do mês
   e dia da semana e outras strings respeitam o idioma corrente definido
   com a função <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span>.
  </p>
  <div class="warning"><strong class="warning">Aviso</strong>
   <p class="para">
    Nem todos os especificadores de conversão podem ser suportados por suas bibliotecas C, e nestes
    casos eles não serão suportados pela função do PHP <span class="function"><strong>strftime()</strong></span>.
    Além disso, nem todas as plataformas suportam timestamps negativos, então sua
    faixa de datas pode ficar limitada a um valor não anterior à época Unix. Isto significa que
    %e, %T, %R e %D (e possivelmente outras) - assim como datas anteriores a
    <code class="literal">1 de janeiro de 1970</code> - não funcionarão no Windows, algumas distribuições
    Linux, e alguns outros sistemas operacionais. Para sistemas Windows, uma visão
    completa dos especificadores de conversão suportados podem ser encontrados em
    <a href="http://msdn.microsoft.com/en-us/library/fe06s4ak.aspx" class="link external">&raquo;&nbsp;<abbr title="Microsoft Developer Network">MSDN</abbr></a>.
    No lugar desta função, use
    o método <span class="methodname"><a href="intldateformatter.format.php" class="methodname">IntlDateFormatter::format()</a></span>.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.strftime-parameters">
  <h3 class="title">Parâmetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">format</code></dt>
     <dd>
      <p class="para">
       <table class="doctable table">
        <caption><strong>Os seguintes caracteres são reconhecidos na string do
        parâmetro <code class="parameter">format</code></strong></caption>
        
         <thead>
          <tr>
           <th><code class="parameter">format</code></th>
           <th>Descrição</th>
           <th>Exemplo de valores retornados</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="text-align: center;"><em>Dia</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%a</code></td>
           <td>Representação textual abreviada do dia</td>
           <td><code class="literal">Sun</code> até <code class="literal">Sat</code></td>
          </tr>

          <tr>
           <td><code class="literal">%A</code></td>
           <td>Representação textual completa do dia</td>
           <td><code class="literal">Sunday</code> até <code class="literal">Saturday</code></td>
          </tr>

          <tr>
           <td><code class="literal">%d</code></td>
           <td>Dia do mês, com dois dígitos (com zeros à esquerda)</td>
           <td><code class="literal">01</code> a <code class="literal">31</code></td>
          </tr>

          <tr>
           <td><code class="literal">%e</code></td>
           <td>
            Dia do mês com um dígito, precedido com um espaço. Não
            implementado como descrito no Windows. Veja abaixo para mais informações.
           </td>
           <td><code class="literal"> 1</code> a <code class="literal">31</code></td>
          </tr>

          <tr>
           <td><code class="literal">%j</code></td>
           <td>Dia do ano, com 3 dígitos e zeros à esquerda</td>
           <td><code class="literal">001</code> a <code class="literal">366</code></td>
          </tr>

          <tr>
           <td><code class="literal">%u</code></td>
           <td>Representação numérica, do dia da semana, compatível com a ISO-8601</td>
           <td><code class="literal">1</code> (para segunda-feira) até <code class="literal">7</code> (para domingo)</td>
          </tr>

          <tr>
           <td><code class="literal">%w</code></td>
           <td>Representação numérica do dia da semana</td>
           <td><code class="literal">0</code> (para domingo) até <code class="literal">6</code> (para sábado)</td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Semana</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%U</code></td>
           <td>Número da semana de um dado ano, iniciado com o primeiro
           domingo sendo a primeira semana</td>
           <td><code class="literal">13</code> (como a 13ª semana completa do ano)</td>
          </tr>

          <tr>
           <td><code class="literal">%V</code></td>
           <td>Número da semana, compatível com a ISO-8601:1988 de um dado ano, iniciada com
           a primeira semana do ano com pelo menos 4 finais de semana, sendo a segunda-feira
           como o início da semana.</td>
           <td><code class="literal">01</code> até <code class="literal">53</code> (onde 53
           é responsável por uma sobreposição)</td>
          </tr>

          <tr>
           <td><code class="literal">%W</code></td>
           <td>Representação numérica da semana do ano, começando
           pela primeira segunda-feira como primeira semana</td>
           <td><code class="literal">46</code> (como a 46ª semana do do ano iniciando
           na segunda-feira)</td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Mês</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%b</code></td>
           <td>Nome do mês abreviado, baseado no idioma</td>
           <td><code class="literal">jan</code> até <code class="literal">dez</code></td>
          </tr>

          <tr>
           <td><code class="literal">%B</code></td>
           <td>Nome completo do mês, baseado no idioma</td>
           <td><code class="literal">janeiro</code> até <code class="literal">dezembro</code></td>
          </tr>

          <tr>
           <td><code class="literal">%h</code></td>
           <td>Nome do mês abreviado, baseado no idioma (sinônimo de %b)</td>
           <td><code class="literal">jan</code> até <code class="literal">dez</code></td>
          </tr>

          <tr>
           <td><code class="literal">%m</code></td>
           <td>Representação com dois dígitos do mês</td>
           <td><code class="literal">01</code> (para janeiro) até <code class="literal">12</code> (para dezembro)</td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Ano</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%C</code></td>
           <td>Representação, com dois dígitos, do século (ano dividido por 100, truncado como inteiro)</td>
           <td><code class="literal">19</code> para o século 20</td>
          </tr>

          <tr>
           <td><code class="literal">%g</code></td>
           <td>Representação do ano, com dois dígitos, seguindo o padrão ISO-8601:1988 (veja %V)</td>
           <td>Exemplo: <code class="literal">09</code> de 6 de janeiro de 2009</td>
          </tr>

          <tr>
           <td><code class="literal">%G</code></td>
           <td>Versão de 4 dígitos de %g</td>
           <td>Exemplo: <code class="literal">2008</code> de 3 de janeiro de 2009</td>
          </tr>

          <tr>
           <td><code class="literal">%y</code></td>
           <td>Representação, com dois dígitos, do ano</td>
           <td>Exemplo: <code class="literal">09</code> de 2009, <code class="literal">79</code> de 1979</td>
          </tr>

          <tr>
           <td><code class="literal">%Y</code></td>
           <td>Representação, com quatro dígitos, do ano</td>
           <td>Exemplo: <code class="literal">2038</code></td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Hora</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%H</code></td>
           <td>Representação, com dois dígitos, da hora no formato 24 horas</td>
           <td><code class="literal">00</code> até <code class="literal">23</code></td>
          </tr>

          <tr>
           <td><code class="literal">%k</code></td>
           <td>Representação da hora no formato 24 horas, com um espaço precedendo dígito único</td>
           <td><code class="literal"> 0</code> até <code class="literal">23</code></td>
          </tr>

          <tr>
           <td><code class="literal">%I</code></td>
           <td>Representação, com dois dígitos, da hora no formato 12 horas</td>
           <td><code class="literal">01</code> até <code class="literal">12</code></td>
          </tr>

          <tr>
           <td><code class="literal">%l (&#039;L&#039; minúsculo)</code></td>
           <td>Representação da hora no formato 12 horas, com um espaço precedendo dígito único</td>
           <td><code class="literal"> 1</code> até <code class="literal">12</code></td>
          </tr>

          <tr>
           <td><code class="literal">%M</code></td>
           <td>Representação, com dois dígitos, do minuto</td>
           <td><code class="literal">00</code> até <code class="literal">59</code></td>
          </tr>

          <tr>
           <td><code class="literal">%p</code></td>
           <td>&#039;AM&#039; ou &#039;PM&#039; maiúsculo baseado na hora informada</td>
           <td>Exemplo: <code class="literal">AM</code> para 00:31,
           <code class="literal">PM</code> para 22:23. O resultado exato depende do
           sistema operacional, e pode retornar variantes em minúsculoas, ou
           variantes com pontos (como <code class="literal">a.m.</code>).</td>
          </tr>

          <tr>
           <td><code class="literal">%P</code></td>
           <td>&#039;am&#039; ou &#039;pm&#039; maiúsculo baseado na hora informada</td>
           <td>Exemplo: <code class="literal">am</code> para 00:31,
           <code class="literal">pm</code> para 22:23. Não suportado por todos os sistemas
           operacionais.</td>
          </tr>

          <tr>
           <td><code class="literal">%r</code></td>
           <td>O mesmo que &quot;%I:%M:%S %p&quot;</td>
           <td>Exemplo: <code class="literal">09:34:17 PM</code> de 21:34:17</td>
          </tr>

          <tr>
           <td><code class="literal">%R</code></td>
           <td>O mesmo que &quot;%H:%M&quot;</td>
           <td>Exemplo: <code class="literal">00:35</code> de 12:35 AM, <code class="literal">16:44</code> de 4:44 PM</td>
          </tr>

          <tr>
           <td><code class="literal">%S</code></td>
           <td>Representação, com dois dígitos, do segundo</td>
           <td><code class="literal">00</code> até <code class="literal">59</code></td>
          </tr>

          <tr>
           <td><code class="literal">%T</code></td>
           <td>O mesmo que &quot;%H:%M:%S&quot;</td>
           <td>Exemplo: <code class="literal">21:34:17</code> para 09:34:17 PM</td>
          </tr>

          <tr>
           <td><code class="literal">%X</code></td>
           <td>Representação escolhida baseada no idioma, sem a data</td>
           <td>Exemplo: <code class="literal">03:59:16</code> ou <code class="literal">15:59:16</code></td>
          </tr>

          <tr>
           <td><code class="literal">%z</code></td>
           <td>O deslocamento do fuso horário. Não implementado como descrito no
           Windows. Veja mais informações a seguir.</td>
           <td>Exemplo: <code class="literal">-0500</code> para hora à leste dos EUA</td>
          </tr>

          <tr>
           <td><code class="literal">%Z</code></td>
           <td>A abreviação do fuso horário. Não implementado como descrito no
           Windows. Veja mais informações a seguir.</td>
           <td>Exemplo: <code class="literal">EST</code> para Eastern Time</td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Carimbos de Data e Hora</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%c</code></td>
           <td>Carimbo escolhido de data e hora baseado no idioma</td>
           <td>Exemplo: <code class="literal">Ter Fev  5 00:45:10 2009</code> de
           February 5, 2009 at 12:45:10 AM</td>
          </tr>

          <tr>
           <td><code class="literal">%D</code></td>
           <td>O mesmo que &quot;%m/%d/%y&quot;</td>
           <td>Exemplo: <code class="literal">02/05/09</code> de February 5, 2009</td>
          </tr>

          <tr>
           <td><code class="literal">%F</code></td>
           <td>O mesmo que &quot;%Y-%m-%d&quot; (geralmente utilizado em carimbos de data em bancos de dados)</td>
           <td>Exemplo: <code class="literal">2009-02-05</code> de February 5, 2009</td>
          </tr>

          <tr>
           <td><code class="literal">%s</code></td>
           <td>Timestamp Unix(o mesmo que a função <span class="function"><a href="function.time.php" class="function">time()</a></span>
           function)</td>
           <td>Exemplo: <code class="literal">305815200</code> de September 10, 1979 08:40:00 AM</td>
          </tr>

          <tr>
           <td><code class="literal">%x</code></td>
           <td>Representação da data baseada na preferência da localidade, sem a hora</td>
           <td>Exemplo: <code class="literal">02/05/09</code> de February 5, 2009</td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Miscelânea</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%n</code></td>
           <td>Uma nova linha (&quot;\n&quot;)</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%t</code></td>
           <td>Um caractere TAB (&quot;\t&quot;)</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%%</code></td>
           <td>Um caractere literal de porcento (&quot;%&quot;)</td>
           <td>---</td>
          </tr>

         </tbody>
        
       </table>

      </p>
      <div class="warning"><strong class="warning">Aviso</strong>
       <p class="simpara">
        Contrário a ISO-9899:1999, o sistema Sun Solaris começa a semana no Domingo, como 1. Resultando
        em <code class="literal">%u</code> não funcionando como descrito neste
        manual.
       </p>
      </div>
      <div class="warning"><strong class="warning">Aviso</strong>
       <p class="para">
        <em>Somente no Windows:</em>
       </p>
       <p class="para">
        O modificador <code class="literal">%e</code> não possui suporte a implementação
        desta função no Windows. Para conseguir este valor, o
        modificador <code class="literal">%#d</code> pode ser utilizado em substituição. O exemplo a seguir
        ilustra como escrever uma função com compatibilidade multiplataforma.
       </p>
       <p class="para">
        Os modificadores <code class="literal">%z</code> e <code class="literal">%Z</code>
        retornam o nome do fuso horário em vez do deslocamento ou abreviação do mesmo.
       </p>
      </div>
      <div class="warning"><strong class="warning">Aviso</strong>
       <p class="simpara">
        <em>macOS e musl somente:</em> O modificador <code class="literal">%P</code>
        não é suportado na implementação macOS desta função.
       </p>
      </div>
     </dd>
    

    
<dt><code class="parameter">timestamp</code></dt><dd><p class="para">
O parâmetro opcional <code class="parameter">timestamp</code> é um
<span class="type"><a href="language.types.integer.php" class="type int">int</a></span> de timestamp Unix cujo padrão é a hora local
atual se <code class="parameter">timestamp</code> não for informado ou for <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>. Em outras
palavras, o padrão é o valor de <span class="function"><a href="function.time.php" class="function">time()</a></span>.
</p></dd>

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


 <div class="refsect1 returnvalues" id="refsect1-function.strftime-returnvalues">
  <h3 class="title">Valor Retornado</h3>
  <p class="para">
   Retorna uma string formatada de acordo com o <code class="parameter">format</code>
   informado em <code class="parameter">timestamp</code> ou o horário local
   atual se nenhum timestamp foi informado. Nomes de meses e dia da semana, e outras strings dependentes de linguagens
   respeitam o idioma definido
   com a função <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span>.
   A função retorna <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> se <code class="parameter">format</code> for vazio, contém especificadores
   de conversão não suportados, ou se o comprimento da string retornada fosse
   maior que <code class="literal">4095</code>.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.strftime-errors">
  <h3 class="title">Erros/Exceções</h3>
  <p class="para">
Toda chamada a uma função de data/hora gerará um <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>
se o fuso horário não for válido. Veja também <span class="function"><a href="function.date-default-timezone-set.php" class="function">date_default_timezone_set()</a></span></p>
  <p class="para">
   Como a saída depende da biblioteca C disponível, alguns especificadores de
   conversão não possuem suporte. No Windows, informar especificadores de
   conversão desconhecidos resultará em mensagens <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> e
   retornará <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>. Em outros sistemas operacionais, pode não haver nenhuma
   mensagem <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> e a saída poderá conter os
   especificadores de conversão não convertidos.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.strftime-changelog">
  <h3 class="title">Registro de Alterações</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Versão</th>
       <th>Descrição</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">timestamp</code> agora pode ser nulo.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.strftime-examples">
  <h3 class="title">Exemplos</h3>
  <p class="para">
   Este exemplo funciona se os respectivos idiomas estiverem instalados
   no sistema.
   <div class="example" id="example-1">
    <p><strong>Exemplo #1 Exemplo da função <span class="function"><strong>strftime()</strong></span> com idiomas</strong></p>
    <div class="example-contents">
<div class="annotation-non-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">, </span><span style="color: #DD0000">"C"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%A"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">, </span><span style="color: #DD0000">"fi_FI"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">" em finlandês é %A,"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">, </span><span style="color: #DD0000">"fr_FR"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">" em francês %A e"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">, </span><span style="color: #DD0000">"de_DE"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">" em alemão %A.\n"</span><span style="color: #007700">);</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Exemplo #2 Exemplo do número de semana ISO 8601:1988 </strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*     Dezembro 2002 / Janeiro 2003<br />ISOWk  M   Tu  W   Thu F   Sa  Su<br />----- ----------------------------<br />51     16  17  18  19  20  21  22<br />52     23  24  25  26  27  28  29<br />1      30  31   1   2   3   4   5<br />2       6   7   8   9  10  11  12<br />3      13  14  15  16  17  18  19   */<br /><br />// Mostra: 12/28/2002 - %V,%G,%Y = 52,2002,2002<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"12/28/2002 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"12/28/2002"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Mostra: 12/30/2002 - %V,%G,%Y = 1,2003,2002<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"12/30/2002 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"12/30/2002"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Mostra: 1/3/2003 - %V,%G,%Y = 1,2003,2003<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"1/3/2003 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1/3/2003"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Mostra: 1/10/2003 - %V,%G,%Y = 2,2003,2003<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"1/10/2003 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1/10/2003"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /><br /><br /></span><span style="color: #FF8000">/*     Dezembro 2004 / Janeiro 2005<br />ISOWk  M   Tu  W   Thu F   Sa  Su<br />----- ----------------------------<br />51     13  14  15  16  17  18  19<br />52     20  21  22  23  24  25  26<br />53     27  28  29  30  31   1   2<br />1       3   4   5   6   7   8   9<br />2      10  11  12  13  14  15  16   */<br /><br />// Mostra: 12/23/2004 - %V,%G,%Y = 52,2004,2004<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"12/23/2004 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"12/23/2004"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Mostra: 12/31/2004 - %V,%G,%Y = 53,2004,2004<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"12/31/2004 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"12/31/2004"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Mostra: 1/2/2005 - %V,%G,%Y = 53,2004,2005<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"1/2/2005 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1/2/2005"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Mostra: 1/3/2005 - %V,%G,%Y = 1,2005,2005<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"1/3/2005 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1/3/2005"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-3">
    <p><strong>Exemplo #3 Exemplo do uso do modificador <code class="literal">%e</code> compatível com múltiplas plataformas</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// Jan 1: resulta em: '%e%1%' (%%, e, %%, %e, %%)<br /></span><span style="color: #0000BB">$format </span><span style="color: #007700">= </span><span style="color: #DD0000">'%%e%%%e%%'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Verifica se está no Windows e substitui o modificador %e<br />// adequadamente<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">strtoupper</span><span style="color: #007700">(</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">PHP_OS</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">3</span><span style="color: #007700">)) == </span><span style="color: #DD0000">'WIN'</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">$format </span><span style="color: #007700">= </span><span style="color: #0000BB">preg_replace</span><span style="color: #007700">(</span><span style="color: #DD0000">'#(?&lt;!%)((?:%%)*)%e#'</span><span style="color: #007700">, </span><span style="color: #DD0000">'\1%#d'</span><span style="color: #007700">, </span><span style="color: #0000BB">$format</span><span style="color: #007700">);<br />}<br /><br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #0000BB">$format</span><span style="color: #007700">);</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-4">
    <p><strong>Exemplo #4 Mostra os formatos conhecidos e desconhecidos</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// Descreve os formatos<br /></span><span style="color: #0000BB">$strftimeFormats </span><span style="color: #007700">= array(<br />    </span><span style="color: #DD0000">'A' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'A full textual representation of the day'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'B' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Full month name, based on the locale'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'C' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two digit representation of the century (year divided by 100, truncated to an integer)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'D' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Same as "%m/%d/%y"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'E' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'F' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Same as "%Y-%m-%d"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'G' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'The full four-digit version of %g'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'H' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two digit representation of the hour in 24-hour format'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'I' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two digit representation of the hour in 12-hour format'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'J' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'K' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'L' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'M' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two digit representation of the minute'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'N' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'O' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'P' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'lower-case "am" or "pm" based on the given time'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'Q' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'R' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Same as "%H:%M"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'S' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two digit representation of the second'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'T' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Same as "%H:%M:%S"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'U' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Week number of the given year, starting with the first Sunday as the first week'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'V' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'W' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'A numeric representation of the week of the year, starting with the first Monday as the first week'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'X' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Preferred time representation based on locale, without the date'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'Y' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Four digit representation for the year'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'Z' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'The time zone offset/abbreviation option NOT given by %z (depends on operating system)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'a' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'An abbreviated textual representation of the day'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'b' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Abbreviated month name, based on the locale'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'c' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Preferred date and time stamp based on local'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'d' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two-digit day of the month (with leading zeros)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'e' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Day of the month, with a space preceding single digits'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'f' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'g' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two digit representation of the year going by ISO-8601:1988 standards (see %V)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'h' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Abbreviated month name, based on the locale (an alias of %b)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'i' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'j' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Day of the year, 3 digits with leading zeros'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'k' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Hour in 24-hour format, with a space preceding single digits'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'l' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Hour in 12-hour format, with a space preceding single digits'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'m' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two digit representation of the month'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'n' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'A newline character ("\n")'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'o' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'p' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'UPPER-CASE "AM" or "PM" based on the given time'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'q' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'r' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Same as "%I:%M:%S %p"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'s' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Unix Epoch Time timestamp'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'t' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'A Tab character ("\t")'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'u' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'ISO-8601 numeric representation of the day of the week'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'v' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'w' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Numeric representation of the day of the week'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'x' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Preferred date representation based on locale, without the time'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'y' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Two digit representation of the year'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'z' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Either the time zone offset from UTC or the abbreviation (depends on operating system)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'%' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'A literal percentage character ("%")'</span><span style="color: #007700">,<br />);<br /><br /></span><span style="color: #FF8000">// Resultados<br /></span><span style="color: #0000BB">$strftimeValues </span><span style="color: #007700">= array();<br /><br /></span><span style="color: #FF8000">// Avalia os formatos enqunto suprime os erros.<br /></span><span style="color: #007700">foreach (</span><span style="color: #0000BB">$strftimeFormats </span><span style="color: #007700">as </span><span style="color: #0000BB">$format </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$description</span><span style="color: #007700">) {<br />    if (</span><span style="color: #0000BB">false </span><span style="color: #007700">!== (</span><span style="color: #0000BB">$value </span><span style="color: #007700">= @</span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%</span><span style="color: #007700">{</span><span style="color: #0000BB">$format</span><span style="color: #007700">}</span><span style="color: #DD0000">"</span><span style="color: #007700">))) {<br />        </span><span style="color: #0000BB">$strftimeValues</span><span style="color: #007700">[</span><span style="color: #0000BB">$format</span><span style="color: #007700">] = </span><span style="color: #0000BB">$value</span><span style="color: #007700">;<br />    }<br />}<br /><br /></span><span style="color: #FF8000">// Encontra o valor mais longo<br /></span><span style="color: #0000BB">$maxValueLength </span><span style="color: #007700">= </span><span style="color: #0000BB">2 </span><span style="color: #007700">+ </span><span style="color: #0000BB">max</span><span style="color: #007700">(</span><span style="color: #0000BB">array_map</span><span style="color: #007700">(</span><span style="color: #DD0000">'strlen'</span><span style="color: #007700">, </span><span style="color: #0000BB">$strftimeValues</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">// Reporta formatos conhecidos<br /></span><span style="color: #007700">foreach (</span><span style="color: #0000BB">$strftimeValues </span><span style="color: #007700">as </span><span style="color: #0000BB">$format </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$value</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"Formato conhecido    : '</span><span style="color: #007700">{</span><span style="color: #0000BB">$format</span><span style="color: #007700">}</span><span style="color: #DD0000">' = "</span><span style="color: #007700">, </span><span style="color: #0000BB">str_pad</span><span style="color: #007700">(</span><span style="color: #DD0000">"'</span><span style="color: #007700">{</span><span style="color: #0000BB">$value</span><span style="color: #007700">}</span><span style="color: #DD0000">'"</span><span style="color: #007700">, </span><span style="color: #0000BB">$maxValueLength</span><span style="color: #007700">), </span><span style="color: #DD0000">" ( </span><span style="color: #007700">{</span><span style="color: #0000BB">$strftimeFormats</span><span style="color: #007700">[</span><span style="color: #0000BB">$format</span><span style="color: #007700">]}</span><span style="color: #DD0000"> )\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #FF8000">// Reporta formatos desconhecidos<br /></span><span style="color: #007700">foreach (</span><span style="color: #0000BB">array_diff_key</span><span style="color: #007700">(</span><span style="color: #0000BB">$strftimeFormats</span><span style="color: #007700">, </span><span style="color: #0000BB">$strftimeValues</span><span style="color: #007700">) as </span><span style="color: #0000BB">$format </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$description</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"Formato desconhecido : '</span><span style="color: #007700">{</span><span style="color: #0000BB">$format</span><span style="color: #007700">}</span><span style="color: #DD0000">'   "</span><span style="color: #007700">, </span><span style="color: #0000BB">str_pad</span><span style="color: #007700">(</span><span style="color: #DD0000">' '</span><span style="color: #007700">, </span><span style="color: #0000BB">$maxValueLength</span><span style="color: #007700">), (</span><span style="color: #0000BB">$description </span><span style="color: #007700">? </span><span style="color: #DD0000">" ( </span><span style="color: #007700">{</span><span style="color: #0000BB">$description</span><span style="color: #007700">}</span><span style="color: #DD0000"> )" </span><span style="color: #007700">: </span><span style="color: #DD0000">''</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />}</span></span></code></div>
    </div>

    <div class="example-contents"><p>O exemplo acima produzirá
algo semelhante a:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">Formato conhecido    : &#039;A&#039; = &#039;Friday&#039;            ( A full textual representation of the day )
Formato conhecido    : &#039;B&#039; = &#039;December&#039;          ( Full month name, based on the locale )
Formato conhecido    : &#039;H&#039; = &#039;11&#039;                ( Two digit representation of the hour in 24-hour format )
Formato conhecido    : &#039;I&#039; = &#039;11&#039;                ( Two digit representation of the hour in 12-hour format )
Formato conhecido    : &#039;M&#039; = &#039;24&#039;                ( Two digit representation of the minute )
Formato conhecido    : &#039;S&#039; = &#039;44&#039;                ( Two digit representation of the second )
Formato conhecido    : &#039;U&#039; = &#039;48&#039;                ( Week number of the given year, starting with the first Sunday as the first week )
Formato conhecido    : &#039;W&#039; = &#039;48&#039;                ( A numeric representation of the week of the year, starting with the first Monday as the first week )
Formato conhecido    : &#039;X&#039; = &#039;11:24:44&#039;          ( Preferred time representation based on locale, without the date )
Formato conhecido    : &#039;Y&#039; = &#039;2010&#039;              ( Four digit representation for the year )
Formato conhecido    : &#039;Z&#039; = &#039;GMT Standard Time&#039; ( The time zone offset/abbreviation option NOT given by %z (depends on operating system) )
Formato conhecido    : &#039;a&#039; = &#039;Fri&#039;               ( An abbreviated textual representation of the day )
Formato conhecido    : &#039;b&#039; = &#039;Dec&#039;               ( Abbreviated month name, based on the locale )
Formato conhecido    : &#039;c&#039; = &#039;12/03/10 11:24:44&#039; ( Preferred date and time stamp based on local )
Formato conhecido    : &#039;d&#039; = &#039;03&#039;                ( Two-digit day of the month (with leading zeros) )
Formato conhecido    : &#039;j&#039; = &#039;337&#039;               ( Day of the year, 3 digits with leading zeros )
Formato conhecido    : &#039;m&#039; = &#039;12&#039;                ( Two digit representation of the month )
Formato conhecido    : &#039;p&#039; = &#039;AM&#039;                ( UPPER-CASE &quot;AM&quot; or &quot;PM&quot; based on the given time )
Formato conhecido    : &#039;w&#039; = &#039;5&#039;                 ( Numeric representation of the day of the week )
Formato conhecido    : &#039;x&#039; = &#039;12/03/10&#039;          ( Preferred date representation based on locale, without the time )
Formato conhecido    : &#039;y&#039; = &#039;10&#039;                ( Two digit representation of the year )
Formato conhecido    : &#039;z&#039; = &#039;GMT Standard Time&#039; ( Either the time zone offset from UTC or the abbreviation (depends on operating system) )
Formato conhecido    : &#039;%&#039; = &#039;%&#039;                 ( A literal percentage character (&quot;%&quot;) )
Formato desconhecido : &#039;C&#039;                       ( Two digit representation of the century (year divided by 100, truncated to an integer) )
Formato desconhecido : &#039;D&#039;                       ( Same as &quot;%m/%d/%y&quot; )
Formato desconhecido : &#039;E&#039;
Formato desconhecido : &#039;F&#039;                       ( Same as &quot;%Y-%m-%d&quot; )
Formato desconhecido : &#039;G&#039;                       ( The full four-digit version of %g )
Formato desconhecido : &#039;J&#039;
Formato desconhecido : &#039;K&#039;
Formato desconhecido : &#039;L&#039;
Formato desconhecido : &#039;N&#039;
Formato desconhecido : &#039;O&#039;
Formato desconhecido : &#039;P&#039;                       ( lower-case &quot;am&quot; or &quot;pm&quot; based on the given time )
Formato desconhecido : &#039;Q&#039;
Formato desconhecido : &#039;R&#039;                       ( Same as &quot;%H:%M&quot; )
Formato desconhecido : &#039;T&#039;                       ( Same as &quot;%H:%M:%S&quot; )
Formato desconhecido : &#039;V&#039;                       ( ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week )
Formato desconhecido : &#039;e&#039;                       ( Day of the month, with a space preceding single digits )
Formato desconhecido : &#039;f&#039;
Formato desconhecido : &#039;g&#039;                       ( Two digit representation of the year going by ISO-8601:1988 standards (see %V) )
Formato desconhecido : &#039;h&#039;                       ( Abbreviated month name, based on the locale (an alias of %b) )
Formato desconhecido : &#039;i&#039;
Formato desconhecido : &#039;k&#039;                       ( Hour in 24-hour format, with a space preceding single digits )
Formato desconhecido : &#039;l&#039;                       ( Hour in 12-hour format, with a space preceding single digits )
Formato desconhecido : &#039;n&#039;                       ( A newline character (&quot;\n&quot;) )
Formato desconhecido : &#039;o&#039;
Formato desconhecido : &#039;q&#039;
Formato desconhecido : &#039;r&#039;                       ( Same as &quot;%I:%M:%S %p&quot; )
Formato desconhecido : &#039;s&#039;                       ( Unix Epoch Time timestamp )
Formato desconhecido : &#039;t&#039;                       ( A Tab character (&quot;\t&quot;) )
Formato desconhecido : &#039;u&#039;                       ( ISO-8601 numeric representation of the day of the week )
Formato desconhecido : &#039;v&#039;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.strftime-notes">
  <h3 class="title">Notas</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    %G e %V, que são baseadas nos números de semana da ISO 8601:1988,
    podem dar resultados inesperados (embora corretos), se o sistema numérico
    não for reconhecido perfeitamente. Veja exemplos da %V nesta página do manual.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.strftime-seealso">
  <h3 class="title">Veja Também</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="intldateformatter.format.php" class="methodname" rel="rdfs-seeAlso">IntlDateFormatter::format()</a> - Formata data/hor&aacute;rio como uma string</span></li>
    <li><span class="methodname"><a href="datetime.format.php" class="methodname" rel="rdfs-seeAlso">DateTimeInterface::format()</a> - Retorna a data formatada de acordo com um formato informado</span></li>
    <li><a href="http://strftime.net/" class="link external">&raquo;&nbsp;Ferramenta online para criação de formatos compatíveis com o strftime()</a></li>
    <li><span class="function"><a href="function.setlocale.php" class="function" rel="rdfs-seeAlso">setlocale()</a> - Define informa&ccedil;&atilde;o de localidade</span></li>
    <li><span class="function"><a href="function.mktime.php" class="function" rel="rdfs-seeAlso">mktime()</a> - Obt&eacute;m um timestamp Unix de uma data</span></li>
    <li><span class="function"><a href="function.strptime.php" class="function" rel="rdfs-seeAlso">strptime()</a> - Interpreta uma data/hor&aacute;rio gerada pela fun&ccedil;&atilde;o strftime</span></li>
    <li><span class="function"><a href="function.gmstrftime.php" class="function" rel="rdfs-seeAlso">gmstrftime()</a> - Formata uma data/hor&aacute;rio GMT/UTC de acordo com as configura&ccedil;&otilde;es de localidade</span></li>
    <li><a href="http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html" class="link external">&raquo;&nbsp;Especificação Open Group da <span class="function"><strong>strftime()</strong></span></a></li>
   </ul>
  </p>
 </div>

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