Skip to content

Commit e6e27ea

Browse files
committed
Use correct UTC timezone string
1 parent d622a12 commit e6e27ea

File tree

12 files changed

+18
-18
lines changed

12 files changed

+18
-18
lines changed

src/controllers/Document/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected function handlePost(Router &$router, DocumentEditModel &$model) {
121121
$model->document->getEditedCount() + 1
122122
);
123123
$model->document->setEditedDateTime(
124-
new DateTime("now", new DateTimeZone("Etc/UTC"))
124+
new DateTime( 'now', new DateTimeZone( 'Etc/UTC' ))
125125
);
126126

127127
$success = $model->document->save();

src/controllers/Document/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function &run(Router &$router, View &$view, array &$args) {
4545

4646
// Objectify for JSON
4747
if ($view instanceof DocumentIndexJSONView) {
48-
$model->timestamp = new DateTime("now", new DateTimeZone("Etc/UTC"));
48+
$model->timestamp = new DateTime( 'now', new DateTimeZone( 'Etc/UTC' ));
4949
$documents = [];
5050
foreach ($model->documents as $document) {
5151
$documents[] = [

src/controllers/News/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function handlePost(Router &$router, NewsEditModel &$model) {
139139
$model->news_post->getEditedCount() + 1
140140
);
141141
$model->news_post->setEditedDateTime(
142-
new DateTime("now", new DateTimeZone("Etc/UTC"))
142+
new DateTime( 'now', new DateTimeZone( 'Etc/UTC' ))
143143
);
144144

145145
$success = $model->news_post->save();

src/controllers/Packet/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected function handlePost(Router &$router, PacketEditModel &$model) {
133133
$model->packet->getEditedCount() + 1
134134
);
135135
$model->packet->setEditedDateTime(
136-
new DateTime("now", new DateTimeZone("Etc/UTC"))
136+
new DateTime( 'now', new DateTimeZone( 'Etc/UTC' ))
137137
);
138138

139139
$success = $model->packet->update();

src/controllers/User/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function getUserInfo(UserViewModel &$model) {
9595
// How long have they been a member?
9696
$model->user_est = Common::intervalToString(
9797
$model->user->getCreatedDateTime()->diff(
98-
new DateTime("now", new DateTimeZone("Etc/UTC"))
98+
new DateTime( 'now', new DateTimeZone( 'Etc/UTC' ))
9999
)
100100
);
101101
$user_est_comma = strpos($model->user_est, ",");

src/libraries/Comment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function getCreatedDateTime() {
186186
if (is_null($this->created_datetime)) {
187187
return $this->created_datetime;
188188
} else {
189-
$tz = new DateTimeZone("UTC");
189+
$tz = new DateTimeZone( 'Etc/UTC' );
190190
$dt = new DateTime($this->created_datetime);
191191
$dt->setTimezone($tz);
192192
return $dt;
@@ -201,7 +201,7 @@ public function getEditedDateTime() {
201201
if (is_null($this->edited_datetime)) {
202202
return $this->edited_datetime;
203203
} else {
204-
$tz = new DateTimeZone("UTC");
204+
$tz = new DateTimeZone( 'Etc/UTC' );
205205
$dt = new DateTime($this->edited_datetime);
206206
$dt->setTimezone($tz);
207207
return $dt;

src/libraries/Document.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function getCreatedDateTime() {
176176
if (is_null($this->created_datetime)) {
177177
return $this->created_datetime;
178178
} else {
179-
$tz = new DateTimeZone("UTC");
179+
$tz = new DateTimeZone( 'Etc/UTC' );
180180
$dt = new DateTime($this->created_datetime);
181181
$dt->setTimezone($tz);
182182
return $dt;
@@ -229,7 +229,7 @@ public function getEditedDateTime() {
229229
if (is_null($this->edited_datetime)) {
230230
return $this->edited_datetime;
231231
} else {
232-
$tz = new DateTimeZone("UTC");
232+
$tz = new DateTimeZone( 'Etc/UTC' );
233233
$dt = new DateTime($this->edited_datetime);
234234
$dt->setTimezone($tz);
235235
return $dt;

src/libraries/Event.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function getEventDateTime() {
152152
if ( is_null( $this->event_datetime ) ) {
153153
return $this->event_datetime;
154154
} else {
155-
$tz = new DateTimeZone( 'UTC' );
155+
$tz = new DateTimeZone( 'Etc/UTC' );
156156
$dt = new DateTime( $this->event_datetime );
157157
$dt->setTimezone( $tz );
158158
return $dt;

src/libraries/NewsPost.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function getCreatedDateTime() {
239239
if (is_null($this->created_datetime)) {
240240
return $this->created_datetime;
241241
} else {
242-
$tz = new DateTimeZone("UTC");
242+
$tz = new DateTimeZone( 'Etc/UTC' );
243243
$dt = new DateTime($this->created_datetime);
244244
$dt->setTimezone($tz);
245245
return $dt;
@@ -254,7 +254,7 @@ public function getEditedDateTime() {
254254
if (is_null($this->edited_datetime)) {
255255
return $this->edited_datetime;
256256
} else {
257-
$tz = new DateTimeZone("UTC");
257+
$tz = new DateTimeZone( 'Etc/UTC' );
258258
$dt = new DateTime($this->edited_datetime);
259259
$dt->setTimezone($tz);
260260
return $dt;

src/libraries/Packet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public function getCreatedDateTime() {
290290
return $this->created_datetime;
291291
}
292292

293-
$tz = new DateTimeZone( 'UTC' );
293+
$tz = new DateTimeZone( 'Etc/UTC' );
294294
$dt = new DateTime( $this->created_datetime );
295295

296296
$dt->setTimezone( $tz );
@@ -307,7 +307,7 @@ public function getEditedDateTime() {
307307
return $this->edited_datetime;
308308
}
309309

310-
$tz = new DateTimeZone( 'UTC' );
310+
$tz = new DateTimeZone( 'Etc/UTC' );
311311
$dt = new DateTime( $this->edited_datetime );
312312

313313
$dt->setTimezone( $tz );

0 commit comments

Comments
 (0)