Skip to content

Commit

Permalink
fixed timezone bug in DateTimeToTimestampTransformer
Browse files Browse the repository at this point in the history
  • Loading branch information
alan0101c committed Mar 12, 2012
1 parent bc1471d commit 486d576
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public function reverseTransform($value)
}

try {
$dateTime = new \DateTime(sprintf("@%s %s", $value, $this->outputTimezone));
$dateTime = new \DateTime();
$dateTime->setTimezone(new \DateTimeZone($this->outputTimezone));
$dateTime->setTimestamp($value);

if ($this->inputTimezone !== $this->outputTimezone) {
$dateTime->setTimezone(new \DateTimeZone($this->inputTimezone));
Expand Down

0 comments on commit 486d576

Please sign in to comment.