# Date.getMilliseconds()

The getMilliseconds() method returns the milliseconds in the specified date according to local time.

```javascript
var moonLanding = new Date('July 20, 69 00:20:18');
moonLanding.setMilliseconds(123);

console.log(moonLanding.getMilliseconds());
// expected output: 123

```

## Syntax <a href="#syntax" id="syntax"></a>

```javascript
dateObj.getMilliseconds()
```

**Return value**&#x20;

A number, between 0 and 999, representing the milliseconds for the given date according to local time.

## Examples <a href="#examples" id="examples"></a>

#### Using `getMilliseconds()` <a href="#using_getmilliseconds" id="using_getmilliseconds"></a>

The following example assigns the milliseconds portion of the current time to the variable `milliseconds`:

```javascript
var today = new Date();
var milliseconds = today.getMilliseconds();
```

## References <a href="#references" id="references"></a>

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds>" %}

## Contributors to this page <a href="#contributors-to-this-page" id="contributors-to-this-page"></a>

Uros Durdevic
