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:
commit
930500a2dd
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user