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); + } }