Skip to content

Commit 8cd4cd3

Browse files
committed
refactor: Time::getDst()
1 parent 052817b commit 8cd4cd3

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

system/I18n/Time.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -479,21 +479,7 @@ public function getQuarter(): string
479479
*/
480480
public function getDst(): bool
481481
{
482-
// grab the transactions that would affect today
483-
$start = strtotime('-1 year', $this->getTimestamp());
484-
$end = strtotime('+2 year', $start);
485-
$transitions = $this->timezone->getTransitions($start, $end);
486-
487-
$daylightSaving = false;
488-
489-
foreach ($transitions as $transition) {
490-
if ($transition['time'] > $this->format('U')) {
491-
$daylightSaving = (bool) ($transition['isdst'] ?? $daylightSaving);
492-
break;
493-
}
494-
}
495-
496-
return $daylightSaving;
482+
return (bool) $this->format('I');
497483
}
498484

499485
/**

0 commit comments

Comments
 (0)