2009-01-06 14:55:00 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 06:46:52 +00:00
|
|
|
<!-- $Revision$ -->
|
2009-01-06 14:55:00 +00:00
|
|
|
|
|
|
|
<refentry xml:id="datetime.gettimestamp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
|
|
<refnamediv>
|
2013-05-17 18:17:21 +00:00
|
|
|
<refname>DateTime::getTimestamp</refname>
|
|
|
|
<refname>DateTimeImmutable::getTimestamp</refname>
|
2013-05-17 06:06:10 +00:00
|
|
|
<refname>DateTimeInterface::getTimestamp</refname>
|
2011-06-25 19:38:40 +00:00
|
|
|
<refname>date_timestamp_get</refname>
|
2009-01-06 14:55:00 +00:00
|
|
|
<refpurpose>Gets the Unix timestamp</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2010-04-25 14:14:56 +00:00
|
|
|
<para>&style.oop;</para>
|
2010-05-13 15:33:37 +00:00
|
|
|
<methodsynopsis role="oop">
|
2013-05-17 18:17:21 +00:00
|
|
|
<modifier>public</modifier> <type>int</type><methodname>DateTime::getTimestamp</methodname>
|
|
|
|
<void />
|
|
|
|
</methodsynopsis>
|
|
|
|
<methodsynopsis role="DateTimeImmutable">
|
|
|
|
<modifier>public</modifier> <type>int</type><methodname>DateTimeImmutable::getTimestamp</methodname>
|
|
|
|
<void />
|
|
|
|
</methodsynopsis>
|
|
|
|
<methodsynopsis role="DateTimeInterface">
|
2013-05-17 06:06:10 +00:00
|
|
|
<modifier>public</modifier> <type>int</type><methodname>DateTimeInterface::getTimestamp</methodname>
|
2009-01-06 14:55:00 +00:00
|
|
|
<void />
|
|
|
|
</methodsynopsis>
|
2010-04-25 14:14:56 +00:00
|
|
|
<para>&style.procedural;</para>
|
2010-05-18 17:08:30 +00:00
|
|
|
<methodsynopsis role="procedural">
|
2010-04-25 14:14:56 +00:00
|
|
|
<type>int</type><methodname>date_timestamp_get</methodname>
|
2013-05-17 06:06:10 +00:00
|
|
|
<methodparam><type>DateTimeInterface</type><parameter>object</parameter></methodparam>
|
2010-04-25 14:14:56 +00:00
|
|
|
</methodsynopsis>
|
2009-01-06 14:55:00 +00:00
|
|
|
<para>
|
|
|
|
Gets the Unix timestamp.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
&no.function.parameters;
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
2010-05-04 17:21:29 +00:00
|
|
|
Returns the Unix timestamp representing the date.
|
2009-01-06 14:55:00 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2010-04-29 02:59:03 +00:00
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<example>
|
|
|
|
<title><function>DateTime::getTimestamp</function> example</title>
|
|
|
|
<para>&style.oop;</para>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$date = new DateTime();
|
|
|
|
echo $date->getTimestamp();
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
<para>&style.procedural;</para>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$date = date_create();
|
|
|
|
echo date_timestamp_get($date);
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
&examples.outputs.similar;
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
1272509157
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</refsect1>
|
|
|
|
|
2010-04-25 17:16:50 +00:00
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
<para>
|
|
|
|
Using <literal>U</literal> as the parameter to
|
|
|
|
<function>DateTime::format</function>
|
|
|
|
is an alternative when using PHP 5.2.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2009-01-06 14:55:00 +00:00
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2010-04-23 03:06:33 +00:00
|
|
|
<simplelist>
|
2010-05-05 00:51:18 +00:00
|
|
|
<member><function>DateTime::setTimestamp</function></member>
|
|
|
|
<member><function>DateTime::format</function></member>
|
2010-04-23 03:06:33 +00:00
|
|
|
</simplelist>
|
2009-01-06 14:55:00 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2009-01-06 14:55:00 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|