Skip to content

Commit

Permalink
Merge pull request schmittjoh#23 from colinmorelli/master
Browse files Browse the repository at this point in the history
Fix DateTimeZone issue when using the DateTime type
  • Loading branch information
schmittjoh committed Jan 20, 2013
2 parents a9f3100 + bd2d0ea commit f319887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JMS/Serializer/Handler/DateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function deserializeDateTimeFromJson(JsonDeserializationVisitor $visitor,

private function parseDateTime($data, array $type)
{
$timezone = isset($type['params'][1]) ? $type['params'][1] : $this->defaultTimezone;
$timezone = isset($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone;
$format = $this->getFormat($type);
$datetime = \DateTime::createFromFormat($format, (string) $data, $timezone);
if (false === $datetime) {
Expand Down

0 comments on commit f319887

Please sign in to comment.