---
schema_version: "1"
id: c10e0fb2a91923b6d8ca77ac47f11f6b2376fa462252e7a3aec631cf19707e5f
title: isLeapYear
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-core-functions-isleapyear.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-core-functions-isleapyear
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 71f8a2f0ca608cb8b83beea9299a5934ee72e472e441841c5059a9a23834234f
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# isLeapYear

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## isLeapYear(DateTime): Boolean

Returns `true` if it receives a date for a leap year, `false` if not.

This version of `leapYear` acts on a `DateTime` type. Other versions act on the other date and time
formats that DataWeave supports.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>dateTime</code></p></td><td><p>The <code>DateTime</code> value to evaluate.</p></td></tr></tbody></table>

### Example

This example indicates whether the input is a leap year.

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ isLeapYear(|2016-10-01T23:57:59|), isLeapYear(|2017-10-01T23:57:59|) ]
```

#### Output

```JSON
[ true, false ]
```

## isLeapYear(Date): Boolean

Returns `true` if the input `Date` is a leap year, 'false' if not.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>date</code></p></td><td><p>The <code>Date</code> value to evaluate.</p></td></tr></tbody></table>

### Example

This example indicates whether the input is a leap year.

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ isLeapYear(|2016-10-01|), isLeapYear(|2017-10-01|) ]
```

#### Output

```JSON
[ true, false ]
```

## isLeapYear(LocalDateTime): Boolean

Returns `true` if the input local date-time is a leap year, 'false' if not.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>datetime</code></p></td><td><p>A <code>LocalDateTime</code> value to evaluate.</p></td></tr></tbody></table>

### Example

This example indicates whether the input is a leap year. It uses a `map` function to iterate through
the array of its `LocalDateTime` values, applies the `isLeapYear` to those values, returning the
results in an array.

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ |2016-10-01T23:57:59-03:00|, |2016-10-01T23:57:59Z| ] map isLeapYear($)
```

#### Output

```JSON
[ true, true ]
```
