We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d202e46 commit d0a8c67Copy full SHA for d0a8c67
WordPress/Docs/WP/TimezoneChangeStandard.xml
@@ -0,0 +1,22 @@
1
+<documentation title="Disallow the changing of timezone.">
2
+ <standard>
3
+ <![CDATA[
4
+ Using date_default_timezone_set() and similar isn't allowed, instead use WP internal timezone support.
5
+ ]]>
6
+ </standard>
7
+ <code_comparison>
8
+ <code title="Valid: Using WP internal timezone support.">
9
10
+$date = new DateTime();
11
+$date->setTimezone(
12
+ new DateTimeZone( 'America/Toronto' )
13
+);
14
15
+ </code>
16
+ <code title="Invalid: date_default_timezone_set() is used.">
17
18
+date_default_timezone_set( 'Foo/Bar' );
19
20
21
+ </code_comparison>
22
+</documentation>
0 commit comments