> For the complete documentation index, see [llms.txt](https://date.gitbook.io/dateall/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://date.gitbook.io/dateall/javascript/methods/date.getutcseconds.md).

# Date.getUTCSeconds()

Returns the seconds, according to universal time (from 0-59)

The getUTCSeconds() method returns the seconds in the specified date according to universal time.

```javascript
var moonLanding = new Date('July 20, 1969, 20:18:04 UTC');

console.log(moonLanding.getUTCSeconds());
// expected output: 4

```

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

```javascript
dateObj.getUTCSeconds()
```

**Return value**

An integer number, between 0 and 59, representing the seconds in the given date according to universal time.

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

#### Using `getUTCSeconds()` <a href="#using_getutcseconds" id="using_getutcseconds"></a>

The following example assigns the seconds portion of the current time to the variable `seconds`.

```javascript
var today = new Date();
var seconds = today.getUTCSeconds();
```

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

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

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

Uros Durdevic
