diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index 76e63b595..5288243a0 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -82,7 +82,7 @@ class Directory extends FileAbstract implements DirectoryInterface $list = []; foreach (glob($path . DIRECTORY_SEPARATOR . $filter) as $filename) { - $list[] = $filename; + $list[] = str_replace(['/\\', '\\'], ['/', '/'], $filename); } return $list; diff --git a/Utils/RnG/DateTime.php b/Utils/RnG/DateTime.php index 35af4e2eb..4df50aaac 100644 --- a/Utils/RnG/DateTime.php +++ b/Utils/RnG/DateTime.php @@ -28,20 +28,17 @@ class DateTime { /** - * Get a random string. + * Get a random \DateTime. * - * @param string $start Start date - * @param string $end End date + * @param \DateTime $start Start date + * @param \DateTime $end End date * * @return \DateTime * * @since 1.0.0 */ - public static function generateDateTime(string $start, string $end) : \DateTime + public static function generateDateTime(\DateTime $start, \DateTime $end) : \DateTime { - $startDate = strtotime($start); - $endDate = strtotime($end); - - return new \DateTime(date('Y-m-d H:i:s', mt_rand($startDate, $endDate))); + return new \DateTime(date('Y-m-d H:i:s', mt_rand($startDate->getTimestamp(), $endDate->getTimestamp()))); } }