---
schema_version: "1"
id: 33d6e3537b96a9a3784f8a2e7e8e3924c42eb1506eab56c5f3a523738c781e47
title: minutes
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.12/dw-periods-functions-minutes.md
canonical_url: https://docs.mulesoft.com/dataweave/2.12/dw-periods-functions-minutes
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8feb52927a96cb2990fb8c9a62295c63bf8e4f4d7a49362f765379ab43285817
description: MuleSoft Documentation Site
release: "2.12"
latest: false
---
---
product: DataWeave
version: 2.12
---

# minutes

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

## minutes(nMinutes: Number): Period

Creates a Period value from the provided number of minutes.

The function applies the `duration` function to the input value.

_Introduced in DataWeave version 2.4.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>nMinutes</code></p></td><td><p>The number of minutes as a whole or decimal number. A positive or negative number is valid.</p></td></tr></tbody></table>

### Example

This example shows how `minutes` behaves with different inputs. It adds and subtracts hours from
DateTime values. It also converts the decimal value `4.555` into the Period format (`PT4M33.3S`) and
and the whole number `4` into the Period format (`PT4M`). Notice that `minutes(-1) + minutes(2)`
returns the number of seconds.

#### Source

```DataWeave
%dw 2.0
import * from dw::core::Periods
output application/json
---
{
   nextMinute: |2020-10-05T20:22:34.385Z| + minutes(1),
   previousMinute: |2020-10-05T20:22:34.385Z| - minutes(1),
   decimalInputPeriod: minutes(4.555),
   wholeNumberInputPeriod: minutes(4),
   addNegativeValue: minutes(-1) + minutes(2)
}
```

#### Output

```Json
{
   "nextMinute": "2020-10-05T20:23:34.385Z",
   "previousMinute": "2020-10-05T20:21:34.385Z",
   "decimalInputPeriod": "PT4M33.3S",
   "wholeNumberInputPeriod": "PT4M",
   "addNegativeValue": 60
}
```
