[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds [Back]  [Original]

Date.prototype.getUTCSeconds() - JavaScript | MDN

Esta pgina foi traduzida do ingls pela comunidade. Saiba mais e junte-se comunidade MDN Web Docs.

View in English Always switch to English

Date.prototype.getUTCSeconds()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since julho de 2015.

O mtodo getUTCSeconds() retorna os segundos na data informada de acordo com a hora universal.

In this article

Experimente

const moonLanding = new Date("July 20, 1969, 20:18:04 UTC");

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

Sintaxe

dateObj.getUTCSeconds()

Valor de retorno

Um nmero inteiro, entre 0 e 59, representando os segundos da data informada de acordo com a hora universal.

Exemplos

Usando getUTCSeconds()

The following example assigns the seconds portion of the current time to the variabl

O exemplo a seguir atribui a parte dos segundos da hora atual varivel seconds.

js
var today = new Date();
var seconds = today.getUTCSeconds();

Especificaes

Specification
ECMAScript 2027 LanguageSpecification
# sec-date.prototype.getutcseconds

Compatibilidade com navegadores

Veja tambm


Web Proxy Viewer  |  New URL  |  Original Page