---
application: "Intervention Zodiac"
version: "Version 5"
status: "stable"
---

# Intervention Zodiac

## PHP Zodiac Sign Calculator

Intervention Zodiac: PHP library to calculate Western and Chinese zodiac signs from dates. Astrological sign calculator.

### Code Examples

```php
use Intervention\Zodiac\Calculator;
use DateTime;
use Carbon\Carbon;

// calculate zodiac sign from a string date
$zodiac = Calculator::zodiac('1980-09-15'); // virgo

// calculate zodiac sign from a string date
$zodiac = Calculator::zodiac('first day of June 2008'); // gemini

// calculate zodiac sign from DateTime object
$zodiac = Calculator::zodiac(new DateTime('1977-03-15')); // pisces

// get zodiac from a Carbon object
$zodiac = Calculator::zodiac(Carbon::yesterday());

// get zodiac from a Carbon object
$zodiac = Calculator::zodiac(228268800);
```

```php
use Intervention\Zodiac\Calculator;
use DateTime;
use Carbon\Carbon;

// calculate zodiac sing
$zodiac = Calculator::zodiac('1977-06-17');

$name = $zodiac->name(); // 'gemini'
$html = $zodiac->html(); // '♊︎'
$localized = $zodiac->localized('fr'); // Gémeaux
$compatibility = $zodiac->compatibility($zodiac); // 6
```

Read how to [install the package](https://zodiac.intervention.io/v5/introduction/installation.md).

---

## Become a Sponsor

### Intervention Zodiac needs your help to keep the project going

Intervention Zodiac is non-commercial, open source licensed and completely free to use. The considerable
effort required to maintain and develop the software is only possible with the financial support
of sponsors. There are two ways in which you can support this project.

- Support via [GitHub Sponsors](https://github.com/sponsors/Intervention)
- Support via [Ko-Fi](https://ko-fi.com/interventionphp)