Skip to content

Commit

Permalink
Fix #73857: Y2038 issue with getTimestamp and setTimestamp, with alte…
Browse files Browse the repository at this point in the history
…rnative
  • Loading branch information
cmb69 committed Nov 17, 2021
1 parent d332b5a commit d74736d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reference/datetime/datetime/settimestamp.xml
Expand Up @@ -35,6 +35,8 @@
<listitem>
<para>
Unix timestamp representing the date.
Setting timestamps outside the range of &integer; is possible by using
<methodname>DateTime::modify</methodname> with the <literal>@</literal> format.
</para>
</listitem>
</varlistentry>
Expand Down
10 changes: 10 additions & 0 deletions reference/datetime/datetimeinterface/gettimestamp.xml
Expand Up @@ -46,6 +46,16 @@
</para>
</refsect1>

<refsect1 role="errors">
&reftitle.errors;
<para>
If the timestamp cannot be represented as &integer;, a <classname>ValueError</classname>
is thrown. Prior to PHP 8.0.0, &false; was returned in this case.
Still, the timestamp can be retrieved as &string; by using
<methodname>DateTimeInterface::format</methodname> with the <literal>U</literal> format.
</para>
</refsect1>

<refsect1 role="changelog"><!-- {{{ -->
&reftitle.changelog;
<informaltable>
Expand Down

0 comments on commit d74736d

Please sign in to comment.