> This page location: Date Functions > ISFINITE
> Full Neon documentation index: https://neon.com/docs/llms.txt

# PostgreSQL ISFINITE() Function

**Summary**: in this tutorial, you will learn how to use the PostgreSQL `ISFINITE()` function to determine if a date, a timestamp, or an interval is finite or not.

## Introduction to the PostgreSQL ISFINITE() function

The `ISFINITE()` function accepts a [date](../postgresql-tutorial/postgresql-date), a [timestamp](../postgresql-tutorial/postgresql-timestamp), or an [interval](../postgresql-tutorial/postgresql-interval) and returns true if the value is finite.

Here's the syntax of the `ISFINITE()` function:

```sql
isfinite ( value ) → boolean
```

The `isfinite()` function accepts a value with the type date, timestamp, or interval.

The `isfinite()` function returns true if the value is finite or false otherwise. It returns `NULL` if the value is `NULL`.

## PostgreSQL ISFINITE() function examples

Let's explore some examples of using the `ISFINITE()` function.

### 1) Using the ISFINITE() function with dates

The following example uses the `ISFINITE()` function to check if a date is finite or not:

```sql
SELECT ISFINITE('2024-03-20'::date) result;
```

Output:

```text
 result
--------
 t
(1 row)
```

The result is t, which is true in PostgreSQL.

The following example uses the `ISFINITE()` function to determine whether the date infinity is finite or not:

```sql
SELECT ISFINITE(DATE 'infinity') result;
```

Output:

```text
 result
--------
 f
(1 row)
```

The result is false because the infinity date is not finite.

### 2) Using the ISFINITE() function with intervals

The following statement uses the `ISFINITE()` function to check if an interval is finite or not:

```sql
SELECT ISFINITE(INTERVAL '1 day') result;
```

Output:

```text
 result
--------
 t
(1 row)
```

Since PostgreSQL doesn't support infinity intervals, the `ISFINITE()` function always returns true for an interval.

### 3) Using the ISFINITE() function with timestamps

The following statement uses the `ISFINITE()` function to test for a finite timestamp:

```sql
SELECT ISFINITE(TIMESTAMP '2024-03-20 00:00:00') result;
```

Output:

```text
 result
--------
 t
(1 row)
```

The following statement uses the `ISFINITE()` function to check for an infinite timestamp:

```sql
SELECT ISFINITE(TIMESTAMP 'infinity') result;
```

Output:

```text
 result
--------
 f
(1 row)
```

## Summary

- Use the `ISFINITE()` function to test if a date, a timestamp, or an interval is finite or not.

---

## Related docs (Date Functions)

- [AGE](https://neon.com/postgresql/postgresql-date-functions/postgresql-age)
- [AT TIME ZONE Operator](https://neon.com/postgresql/postgresql-date-functions/postgresql-at-time-zone)
- [CLOCK_TIMESTAMP](https://neon.com/postgresql/postgresql-date-functions/postgresql-clock_timestamp)
- [CURRENT_DATE](https://neon.com/postgresql/postgresql-date-functions/postgresql-current_date)
- [CURRENT_TIME](https://neon.com/postgresql/postgresql-date-functions/postgresql-current_time)
- [CURRENT_TIMESTAMP](https://neon.com/postgresql/postgresql-date-functions/postgresql-current_timestamp)
- [DATE_PART](https://neon.com/postgresql/postgresql-date-functions/postgresql-date_part)
- [DATE_TRUNC](https://neon.com/postgresql/postgresql-date-functions/postgresql-date_trunc)
- [EXTRACT](https://neon.com/postgresql/postgresql-date-functions/postgresql-extract)
- [JUSTIFY_DAYS](https://neon.com/postgresql/postgresql-date-functions/postgresql-justify_days)
- [JUSTIFY_HOURS](https://neon.com/postgresql/postgresql-date-functions/postgresql-justify_hours)
- [JUSTIFY_INTERVAL](https://neon.com/postgresql/postgresql-date-functions/postgresql-justify_interval)
- [LOCALTIME](https://neon.com/postgresql/postgresql-date-functions/postgresql-localtime)
- [LOCALTIMESTAMP](https://neon.com/postgresql/postgresql-date-functions/postgresql-localtimestamp)
- [MAKE_DATE](https://neon.com/postgresql/postgresql-date-functions/postgresql-make_date)
- [MAKE_INTERVAL](https://neon.com/postgresql/postgresql-date-functions/postgresql-make_interval)
- [MAKE_TIME](https://neon.com/postgresql/postgresql-date-functions/postgresql-make_time)
- [NOW](https://neon.com/postgresql/postgresql-date-functions/postgresql-now)
- [PG_SLEEP](https://neon.com/postgresql/postgresql-date-functions/postgresql-pg_sleep)
- [STATEMENT_TIMESTAMP](https://neon.com/postgresql/postgresql-date-functions/postgresql-statement_timestamp)
- [TIMEOFDAY](https://neon.com/postgresql/postgresql-date-functions/postgresql-timeofday)
- [TO_DATE](https://neon.com/postgresql/postgresql-date-functions/postgresql-to_date)
- [TO_TIMESTAMP](https://neon.com/postgresql/postgresql-date-functions/postgresql-to_timestamp)
