-
-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See #1722.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |