# toHijri

Source: https://pakdatakit.dev/api/typescript/hijri/functions/tohijri/

```ts
function toHijri(date, options?): HijriDate;
```

Defined in: [hijri.ts:45](https://github.com/chmuzamil/pakdatakit/blob/a6eeaa47381308c4e4fcda45b29642fe4fbfb1fc/src/hijri.ts#L45)

Converts a Gregorian `Date` to a Hijri (Islamic) date.

Uses the tabular (arithmetic, "islamic-civil") calendar. Actual dates in
Pakistan follow moon sighting and can differ by a day or two; pass
`options.offset` to adjust.

## Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `date` | `Date` | Gregorian date (local date components are used) |
| `options?` | [`HijriOptions`](https://pakdatakit.dev/api/typescript/hijri/interfaces/hijrioptions/) | Optional day offset for moon-sighting adjustment |

## Returns

[`HijriDate`](https://pakdatakit.dev/api/typescript/hijri/interfaces/hijridate/)

Hijri date components

## Throws

If `date` is invalid or `offset` is not an integer
