---
title: monthEnd()
slug: monthend
docTags: 
createdAt: 2021-09-14T17:49:41.000Z
---

Returns the last day of a given month.

### Syntax

`monthEnd([date])`

- `date` - (optional) the date from which to derive the last day of that date's month.
- **Return type:&#x20;**[Date](docId\:xTAQdzvLBTAKjxRnpFwe9)&#x20;

### Sample usage

`monthEnd('2020-05-12')` returns `2020-05-31`.

### Supported data types

| **Input type**                            | **Return type**                         | **Logic**                                                                                                     |
| ----------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| ****[Date](docId\:xTAQdzvLBTAKjxRnpFwe9)  | [Date](docId\:xTAQdzvLBTAKjxRnpFwe9)    | The input date specifies the desired month. The month is then used to determine the final date in that month. |
| *Unsupported data types*                  | **[Null](docId\:N9trVqonnBknqL9DrNBP6)  | Unsupported data types return `Null`.                                                                         |

