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

# 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 }
```
