public static function createCarbonFromFormat($format, $str, $timezone = null) { $dateTime = self::createDatetimeFromFormat($format, $str, $timezone); return Carbon::createFromTimestamp($dateTime->getTimestamp(), $dateTime->getTimezone()); }