From df267012c343507695af319e64946576f3084977 Mon Sep 17 00:00:00 2001 From: Baldur Rensch Date: Wed, 7 Aug 2013 20:01:10 -0700 Subject: [PATCH] Fixed missing timezone with dateTimeBetween --- src/Faker/Provider/DateTime.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Faker/Provider/DateTime.php b/src/Faker/Provider/DateTime.php index d9026d80..299edc40 100644 --- a/src/Faker/Provider/DateTime.php +++ b/src/Faker/Provider/DateTime.php @@ -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; } /**