---
schema_version: "1"
id: 33c4270700f65240c789ea7986b704ce1dde53a9477adbf4545e3f0534a40401
title: toMilliseconds
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.6/dw-timer-functions-tomilliseconds.md
canonical_url: https://docs.mulesoft.com/dataweave/2.6/dw-timer-functions-tomilliseconds
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7bca01bd4fccb215d1a26533cb7f0ca9f4325e1ca30ff41405ee5131aa9fbc9a
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
---
product: DataWeave
version: 2.6
---

# toMilliseconds

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

## toMilliseconds(date: DateTime): Number

Returns the representation of a specified date-time in milliseconds.

### 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>A <code>DateTime</code> to evaluate.</p></td></tr></tbody></table>

### Example

This example shows a date-time in milliseconds.

#### Source

```Dataweave
%dw 2.0
import * from dw::util::Timer
output application/json
---
{ "toMilliseconds" : toMilliseconds(|2018-07-23T22:03:04.829Z|) }
```

#### Output

```XML
{ "toMilliseconds": 1532383384829 }
```
