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

# isLeapYear

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

## isLeapYear(dateTime: 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: 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(datetime: 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 ]
```
