Skip to content

Commit

Permalink
Docs: Add TimezoneChange XML doc
Browse files Browse the repository at this point in the history
See #1722.
  • Loading branch information
GaryJones committed Jun 2, 2022
1 parent 7415105 commit b91ac6c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions WordPress/Docs/WP/TimezoneChangeStandard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<documentation title="Disallow the changing of timezone.">
<standard>
<![CDATA[
Using date_default_timezone_set() and similar isn't allowed, instead use WP internal timezone support.
]]>
</standard>
<code_comparison>
<code title="Valid: Using WP internal timezone support.">
<![CDATA[
$date = new DateTime();
$date->setTimezone(
new DateTimeZone( 'America/Toronto' )
);
]]>
</code>
<code title="Invalid: date_default_timezone_set() is used.">
<![CDATA[
date_default_timezone_set( 'Foo/Bar' );
]]>
</code>
</code_comparison>
</documentation>

0 comments on commit b91ac6c

Please sign in to comment.