-
Notifications
You must be signed in to change notification settings - Fork 858
Document createFromTimestamp() for DateTime and DateTimeImmutable #5103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- $Revision$ --> | ||
| <refentry xml:id="datetime.createfromtimestamp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
| <refnamediv> | ||
| <refname>DateTime::createFromTimestamp</refname> | ||
| <refpurpose>Returns a new DateTime instance encapsulating the given timestamp</refpurpose> | ||
| </refnamediv> | ||
|
|
||
| <refsect1 role="description"> | ||
| &reftitle.description; | ||
| <methodsynopsis role="DateTime"> | ||
| <modifier>public</modifier> <modifier>static</modifier> <type>static</type><methodname>DateTime::createFromTimestamp</methodname> | ||
| <methodparam><type>int|float</type><parameter>timestamp</parameter></methodparam> | ||
| </methodsynopsis> | ||
| </refsect1> | ||
|
|
||
| <refsect1 role="parameters"> | ||
| &reftitle.parameters; | ||
| <variablelist> | ||
| <varlistentry> | ||
| <term><parameter>timestamp</parameter></term> | ||
| <listitem> | ||
| <simpara> | ||
| A Unix timestamp. | ||
| </simpara> | ||
| </listitem> | ||
| </varlistentry> | ||
| </variablelist> | ||
| </refsect1> | ||
|
|
||
| <refsect1 role="returnvalues"> | ||
| &reftitle.returnvalues; | ||
| <simpara> | ||
| Returns a new <classname>DateTime</classname> instance. | ||
| </simpara> | ||
| </refsect1> | ||
|
|
||
| <refsect1 role="examples"> | ||
| &reftitle.examples; | ||
| <example> | ||
| <title>Creating a date time object from a timestamp</title> | ||
| <programlisting role="php" annotations="non-interactive"> | ||
| <![CDATA[ | ||
| <?php | ||
| $dt = DateTime::createFromTimestamp( 1403261100 ); | ||
| ]]> | ||
| </programlisting> | ||
| </example> | ||
| </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 | ||
| sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
| 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 | ||
| --> | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,71 @@ | ||||||
| <?xml version="1.0" encoding="utf-8"?> | ||||||
| <!-- $Revision$ --> | ||||||
| <refentry xml:id="datetimeimmutble.createfromtimestamp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| <refnamediv> | ||||||
| <refname>DateTimeImmutable::createFromTimestamp</refname> | ||||||
| <refpurpose>Returns a new DateTimeImmutable instance encapsulating the given timestamp</refpurpose> | ||||||
| </refnamediv> | ||||||
|
|
||||||
| <refsect1 role="description"> | ||||||
| &reftitle.description; | ||||||
| <methodsynopsis role="DateTimeImmutable"> | ||||||
| <modifier>public</modifier> <modifier>static</modifier> <type>static</type><methodname>DateTimeImmutable::createFromTimestamp</methodname> | ||||||
| <methodparam><type>int|float</type><parameter>timestamp</parameter></methodparam> | ||||||
| </methodsynopsis> | ||||||
| </refsect1> | ||||||
|
|
||||||
| <refsect1 role="parameters"> | ||||||
| &reftitle.parameters; | ||||||
| <variablelist> | ||||||
| <varlistentry> | ||||||
| <term><parameter>timestamp</parameter></term> | ||||||
| <listitem> | ||||||
| <simpara> | ||||||
| A Unix timestamp. | ||||||
| </simpara> | ||||||
| </listitem> | ||||||
| </varlistentry> | ||||||
| </variablelist> | ||||||
| </refsect1> | ||||||
mathroc marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| <refsect1 role="returnvalues"> | ||||||
| &reftitle.returnvalues; | ||||||
| <simpara> | ||||||
| Returns a new <classname>DateTimeImmutable</classname> instance. | ||||||
| </simpara> | ||||||
| </refsect1> | ||||||
|
|
||||||
| <refsect1 role="examples"> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be great to add a section |
||||||
| &reftitle.examples; | ||||||
| <example> | ||||||
| <title>Creating a date time object from a timestamp</title> | ||||||
| <programlisting role="php" annotations="non-interactive"> | ||||||
| <![CDATA[ | ||||||
| <?php | ||||||
| $dt = DateTimeImmutable::createFromTimestamp( 1403261100 ); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| ]]> | ||||||
| </programlisting> | ||||||
| </example> | ||||||
| </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 | ||||||
| sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||||||
| 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 | ||||||
| --> | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it could be interesting to add an example with a float as a parameter ?