From 226ca98982dddbc04d97ce70015954eed352a8b3 Mon Sep 17 00:00:00 2001 From: Nasser Date: Mon, 16 Sep 2019 19:25:20 +0430 Subject: [PATCH] change carbon to date time --- src/Verta.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Verta.php b/src/Verta.php index 976dd04..14c8937 100755 --- a/src/Verta.php +++ b/src/Verta.php @@ -13,7 +13,6 @@ namespace Hekmatinasser\Verta; use DateTime; use DateTimeZone; -use Illuminate\Support\Carbon; use InvalidArgumentException; use Hekmatinasser\Notowo\Notowo; @@ -247,7 +246,8 @@ class Verta extends DateTime { */ public function __construct($datetime = null, $timezone = null) { if ($datetime === null) { - $instance = Carbon::now()->getTimestamp(); + $object = new DateTime(); + $instance = $object->getTimestamp(); } elseif (is_string($datetime)){ $object = date_create($datetime); @@ -509,7 +509,8 @@ class Verta extends DateTime { public static function createGregorian($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null) { - $now = date('Y-n-j-G-i-s', Carbon::now()->getTimestamp()); + $object = new DateTime(); + $now = date('Y-n-j-G-i-s', $object->getTimestamp()->getTimestamp()); $defaults = array_combine(array('year', 'month', 'day', 'hour', 'minute', 'second'), explode('-', $now)); $year = $year === null ? intval($defaults['year']) : $year;