From 523bdc180b873600d543c6cb7f0f53bb945f569f Mon Sep 17 00:00:00 2001 From: nasser Date: Sat, 20 Aug 2022 23:32:07 +0430 Subject: [PATCH] add convert carbon --- src/Verta.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Verta.php b/src/Verta.php index 3544a99..bfc0922 100755 --- a/src/Verta.php +++ b/src/Verta.php @@ -2,8 +2,21 @@ namespace Hekmatinasser\Verta; +use Exception; use Hekmatinasser\Jalali\Jalali; +use Illuminate\Support\Carbon; class Verta extends Jalali { + + /** + * Create a Carbon instance from Verta + * + * @return Carbon + * @throws Exception + */ + public function toCarbon(): Carbon + { + return new Carbon($this->datetime(), $this->timezone); + } }