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

# Intervention Zodiac

## PHP Zodiac Sign Calculator

Intervention Zodiac is a astrological calculator that resolves Western and Chinese zodiac signs from various data types.

## Zodiac Calculator

Intervention Zodiac is a powerful, developer-friendly tool for effortless
zodiac sign calculation. This versatile PHP library lets you generate zodiac
signs from various date formats, including natural language strings, Unix
timestamps and `DateTimeInterface` instances.

Whether you're building horoscope features or astrology apps the Zodiac
Calculator effortless delivers results for western as well as traditional
chinese zodiac signs.

- Fluent interface to calculate zodiac signs
- Support for western and chinese astrology
- Framework-agnostic

### Code Examples

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

// create calculator
$calculator = new Calculator(Astrology::WESTERN);

// calculate various date formats
$sign = $calculator->calculate('2001-01-01');
$sign = $calculator->calculate('first day of june 2014');
$sign = $calculator->calculate('2018-06-15 12:34:00');
$sign = $calculator->calculate(new DateTime('2001-01-01'));
$sign = $calculator->calculate(Carbon::yesterday());
$sign = $calculator->calculate(228268800);
$sign = $calculator->calculate('228268800');

// override the default astrology
$sign = $calculator->calculate('2001-01-01', Astrology::CHINESE);
```

Read more about the [calculator](https://zodiac.intervention.io/v7/api/calculator.md).

## Zodiac Signs

Unlock insights by accessing the countless data properties of zodiac sign
objects. Designed for flexible data handling, the sign instances come with
built-in language translation and even compatibility scores.

### Code Examples

```php
use Intervention\Zodiac\Sign;
use Intervention\Zodiac\Chinese\Sign as ChineseSign;
use Intervention\Zodiac\Western\Sign as WesternSign;
use DateTime;

// parse signs directly
$sign = Sign::fromString('2000-01-01');
$sign = Sign::fromString('first day of june 2014', Astrology::CHINESE);
$sign = Sign::fromDate(new DateTime('2001-01-01'), Astrology::WESTERN);
$sign = Sign::fromUnix(228268800, Astrology::WESTERN);
$sign = Sign::fromUnix('228268800', Astrology::CHINESE);

// parse only western signs
$sign = WesternSign::fromString('2000-01-01');

// parse only chinese signs
$sign = ChineseSign::fromString('2000-01-01');

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

Read more about [zodiac signs](https://zodiac.intervention.io/v7/api/sign.md) or how to [install the package](https://zodiac.intervention.io/v7/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)