1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-19 23:09:47 +01:00

Merge pull request #161 from baldurrensch/timezone_fix

Fixed missing timezone with dateTimeBetween
This commit is contained in:
Francois Zaninotto 2013-10-21 12:19:04 -07:00
commit 930500a2dd

View File

@ -83,7 +83,10 @@ class DateTime extends \Faker\Provider\Base
$endTimestamp = $endDate instanceof \DateTime ? $endDate->getTimestamp() : strtotime($endDate);
$timestamp = mt_rand($startTimestamp, $endTimestamp);
return new \DateTime('@' . $timestamp);
$ts = new \DateTime('@' . $timestamp);
$ts->setTimezone(new \DateTimeZone(date_default_timezone_get()));
return $ts;
}
/**