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

# toMilliseconds

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

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