downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.date-parse.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.date-parse.php',
   
1 => 'date_parse',
  ),
 
'up' =>
  array (
   
0 => 'ref.datetime.php',
   
1 => 'Date/Time Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.date-parse-from-format.php',
   
1 => 'date_parse_from_format',
  ),
 
'next' =>
  array (
   
0 => 'function.date-sub.php',
   
1 => 'date_sub',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.date-parse" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">date_parse</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0)</p><p class="refpurpose"><span class="refname">date_parse</span> &mdash; <span class="dc-title">Returns associative array with detailed info about given date</span></p>

 </div>
 <a name="function.date-parse.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><b>date_parse</b></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$date</tt></span>
   )</div>

 </div>


 <a name="function.date-parse.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">date</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       Date in format accepted by <a href="function.strtotime.php" class="function">strtotime()</a>.
      </p>
     </dd>

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


 <a name="function.date-parse.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <a href="language.types.array.php" class="type array">array</a> with information about the parsed date
   on success or <b><tt class="constant">FALSE</tt></b> on failure.
  </p>
 </div>


 <a name="function.date-parse.errors"></a><div class="refsect1 errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   In case the date format has an error, the element &#039;errors&#039; will
   contains the error messages.
  </p>
 </div>

 
 <a name="function.date-parse.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 A <b>date_parse()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">date_parse</span><span style="color: #007700">(</span><span style="color: #DD0000">"2006-12-12&nbsp;10:00:00.5"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents para"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [year] =&gt; 2006
    [month] =&gt; 12
    [day] =&gt; 12
    [hour] =&gt; 10
    [minute] =&gt; 0
    [second] =&gt; 0
    [fraction] =&gt; 0.5
    [warning_count] =&gt; 0
    [warnings] =&gt; Array()
    [error_count] =&gt; 0
    [errors] =&gt; Array()
    [is_localtime] =&gt;
)
</pre></div>
    </div>
   </div><p>
  </p>
 </div>


 <a name="function.date-parse.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.getdate.php" class="function" rel="rdfs-seeAlso">getdate()</a> - Get date/time information</li>
   </ul><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites