---
title: "to unix milliseconds · RUAL Documentation"
description: "Converts a date, date string, or epoch timestamp to a Unix timestamp in MILLISECONDS : the unit of _meta.ums/cms/rms and of most external APIs. Numbers…"
canonical: https://docs.rual.nl/block-types/date/date_convert_to_unix_milliseconds
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# to unix milliseconds

This block is part of the [`date`](https://docs.rual.nl/block-types/date) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

Converts a date, date string, or epoch timestamp to a Unix timestamp in MILLISECONDS : the unit of _meta.ums/cms/rms and of most external APIs. Numbers (and numeric strings) are detected by size: values of 100000000000 (11 digits, March 1973) and above are already milliseconds and pass through, smaller values are read as seconds and multiplied. Pre-1973 millisecond values are outside the detection range : convert those by hand. Anything non-numeric is parsed like every other date pin, in the entity timezone.

- date required `date` A date object, date string, or epoch timestamp in seconds or milliseconds.

- unix milliseconds `number` The Unix timestamp in milliseconds. 0 when the input could not be read as a date.

- valid `condition` False when the input was empty, zero, or unparseable : branch on this rather than trusting a 0.

| `epoch milliseconds` |
| --- |
| `seconds to milliseconds` |
| `ums` |
| `javascript timestamp` |

A typical wiring for [to unix milliseconds](https://docs.rual.nl/block-types/date/date_convert_to_unix_milliseconds): [date now](https://docs.rual.nl/block-types/date/date_currentdate) feeds the `date` pin; the `number` out pin feeds [cast to value](https://docs.rual.nl/block-types/type%2520casting/number_convert_to_value).

[![Studio canvas example for the to unix milliseconds block: typical wiring for to unix milliseconds.](https://docs.rual.nl/canvas-examples/date_convert_to_unix_milliseconds.png)](https://docs.rual.nl/canvas-examples/date_convert_to_unix_milliseconds.png?v=3)

## Version history

Introduced in [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

- [Back to `date`](https://docs.rual.nl/block-types/date): Return to the main group to view all sub-groups

- [Back to `date`](https://docs.rual.nl/block-types/date?group=date): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
