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 20, 2019
1 parent d202e46 commit d0a8c67
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 d0a8c67

Please sign in to comment.