1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-21 07:49:53 +01:00

Fixed missing timezone with dateTimeBetween

This commit is contained in:
Baldur Rensch 2013-08-07 20:01:10 -07:00
parent 1deac9d238
commit df267012c3

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;
}
/**