Skip to content

Commit

Permalink
Fixed issue briannesbitt#883: reverted pull-request briannesbitt#548
Browse files Browse the repository at this point in the history
…about issue briannesbitt#88

The realisation of initial issue briannesbitt#88 is wrong. The problem does not relies to `local` / `not local` timezone. Php handles date changes similar for both cases. So in fact changes was made 'fixes' non-local dates but local dates works same as before.
And it 'fixes' the problem and not actually fixes it because in fact the PHP handling of DST changing in non-UTC dates is quite right. If developer don't want to adjusting timestamp to DST change he should use UTC timezone.

Next commits reverted by hand because conflicts in automatic revert.

* Commit 2cc6988  Fix CS	07.12.2015 13:04	Lucas Michot
* Commit 5394301  Fix issue 88	07.12.2015 12:55	Lucas Michot
  • Loading branch information
Ovsyanka committed Feb 13, 2018
1 parent cc6e045 commit 96549a9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
21 changes: 0 additions & 21 deletions src/Carbon/Carbon.php
Original file line number Diff line number Diff line change
Expand Up @@ -3317,27 +3317,6 @@ public function isBirthday(self $dt = null)
return $this->isSameAs('md', $dt);
}

/**
* Consider the timezone when modifying the instance.
*
* @param string $modify
*
* @return static
*/
public function modify($modify)
{
if ($this->local) {
return parent::modify($modify);
}

$timezone = $this->getTimezone();
$this->setTimezone('UTC');
$instance = parent::modify($modify);
$this->setTimezone($timezone);

return $instance;
}

/**
* Return a serialized string of the instance.
*
Expand Down
34 changes: 0 additions & 34 deletions tests/Carbon/ModifyTest.php

This file was deleted.

0 comments on commit 96549a9

Please sign in to comment.