<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.gmstrftime.php',
    1 => 'gmstrftime',
    2 => 'Formate une date/heure GMT/TUC en fonction de la configuration locale',
  ),
  'up' => 
  array (
    0 => 'ref.datetime.php',
    1 => 'Fonctions Date/Heure',
  ),
  'prev' => 
  array (
    0 => 'function.gmmktime.php',
    1 => 'gmmktime',
  ),
  'next' => 
  array (
    0 => 'function.idate.php',
    1 => 'idate',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/datetime/functions/gmstrftime.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.gmstrftime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmstrftime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">gmstrftime</span> &mdash; <span class="dc-title">Formate une date/heure GMT/TUC en fonction de la configuration locale</span></p>

 </div>
 
 <div id="function.gmstrftime-refsynopsisdiv">
  <div class="warning"><strong class="warning">Avertissement</strong><p class="simpara">Cette fonction
est <em>OBSOLÈTE</em> à partir de PHP 8.1.0.
Il est fortement recommandé de les éviter.</p></div>
<p class="para">
 Les alternatives à cette fonction incluent :
</p>

  <ul class="simplelist">
   <li><span class="function"><a href="function.gmdate.php" class="function">gmdate()</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.gmstrftime-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="attribute"><a href="class.deprecated.php">#[\Deprecated]</a> </span><br>
   <span class="methodname"><strong>gmstrftime</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">
   <span class="function"><strong>gmstrftime()</strong></span> se comporte exactement comme
   <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span> hormis le fait que l&#039;heure utilisée
   est celle de Greenwich (<code class="literal">Greenwich Mean Time</code>, GMT).
   Par exemple, dans la zone <code class="literal">Eastern Standard Time</code> 
   (est des USA) est GMT -0500, la première ligne de l&#039;exemple ci-dessous
   affiche <code class="literal">&quot;Dec 31 1998 20:00:00&quot;</code>, tandis que
   la seconde affiche <code class="literal">&quot;Jan 01 1999 01:00:00&quot;</code>.
  </p>
  <div class="warning"><strong class="warning">Avertissement</strong>
   <p class="para">
    Cette fonction dépend des informations locales du système 
    d&#039;exploitation, qui peuvent être incohérentes ou ne pas 
    être disponibles du tout. Utiliser plutôt la méthode
    <span class="methodname"><a href="intldateformatter.format.php" class="methodname">IntlDateFormatter::format()</a></span>.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gmstrftime-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">format</code></dt>
     <dd>
      <p class="para">
       Voir la description de la fonction
       <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span>.
      </p>
     </dd>
    
    
<dt><code class="parameter">timestamp</code></dt><dd><p class="para">
    Le paramètre optionnel <code class="parameter">timestamp</code> est un timestamp
    Unix de type <a href="language.types.integer.php" class="link">entier</a> qui vaut par défaut l&#039;heure courante locale si
    <code class="parameter">timestamp</code> est omis ou <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>. En d&#039;autres
    termes, il vaut par défaut la valeur de la fonction <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.gmstrftime-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne une <a href="language.types.string.php" class="link">chaîne de caractères</a> formatée suivant le format donné par le
   paramètre <code class="parameter">timestamp</code> ou la date courante
   si aucun paramètre <code class="parameter">timestamp</code> n&#039;est fourni.
   Les noms des mois, des jours de la semaine et des autres chaînes
   dépendant d&#039;une localisation donnée, respectent la localisation
   courante définie par la fonction <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span>.
   En cas d&#039;échec, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> est retourné.
    </p>
  </div>


 <div class="refsect1 changelog" id="refsect1-function.gmstrftime-changelog">
  <h3 class="title">Historique</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">timestamp</code> est désormais nullable.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gmstrftime-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>gmstrftime()</strong></span></strong></p>
    <div class="example-contents">
<div class="annotation-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">'en_US'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%b %d %Y %H:%M:%S"</span><span style="color: #007700">, </span><span style="color: #0000BB">mktime</span><span style="color: #007700">(</span><span style="color: #0000BB">20</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">12</span><span style="color: #007700">, </span><span style="color: #0000BB">31</span><span style="color: #007700">, </span><span style="color: #0000BB">98</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #0000BB">gmstrftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%b %d %Y %H:%M:%S"</span><span style="color: #007700">, </span><span style="color: #0000BB">mktime</span><span style="color: #007700">(</span><span style="color: #0000BB">20</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">12</span><span style="color: #007700">, </span><span style="color: #0000BB">31</span><span style="color: #007700">, </span><span style="color: #0000BB">98</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;</span></span></code></div>
    </div>

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


 <div class="refsect1 seealso" id="refsect1-function.gmstrftime-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="intldateformatter.format.php" class="methodname" rel="rdfs-seeAlso">IntlDateFormatter::format()</a> - Formate la date et l'heure sous forme de cha&icirc;ne</span></li>
    <li><span class="methodname"><a href="datetime.format.php" class="methodname" rel="rdfs-seeAlso">DateTimeInterface::format()</a> - Retourne une date format&eacute;e suivant le format fourni</span></li>
    <li><span class="function"><a href="function.strftime.php" class="function" rel="rdfs-seeAlso">strftime()</a> - Formate une date/heure locale avec la configuration locale</span></li>
   </ul>
  </p>
 </div>

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