From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../global_objects/date/settime/index.html | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 files/pt-br/web/javascript/reference/global_objects/date/settime/index.html (limited to 'files/pt-br/web/javascript/reference/global_objects/date/settime/index.html') diff --git a/files/pt-br/web/javascript/reference/global_objects/date/settime/index.html b/files/pt-br/web/javascript/reference/global_objects/date/settime/index.html new file mode 100644 index 0000000000..cc4f4472ba --- /dev/null +++ b/files/pt-br/web/javascript/reference/global_objects/date/settime/index.html @@ -0,0 +1,95 @@ +--- +title: Date.prototype.setTime() +slug: Web/JavaScript/Reference/Global_Objects/Date/setTime +tags: + - Date + - JavaScript + - Prototype + - Referencia + - Tempo + - data + - metodo +translation_of: Web/JavaScript/Reference/Global_Objects/Date/setTime +--- +
{{JSRef}}
+ +
O método setTime() atribui ao objecto {{jsxref("Date")}} a hora representada pelo número de milisegundos desde 1 de janeiro de 1970 as 00:00:00 UTC.
+ +
 
+ +
{{EmbedInteractiveExample("pages/js/date-settime.html")}}
+ + + +

Sintáxe

+ +
dateObj.setTime(timeValue)
+ +

Parâmetros

+ +
+
timeValue
+
Um inteiro representando o número de milisegundos desde 1 de janeiro 1970, 00:00:00 UTC.
+
+ +

Valor retornado

+ +

O número de milisegundos entre 1 de janeiro de 1970 00:00:00 UTC e a data atualizada (efetivamente, o valor do argumento).

+ +

Descrição

+ +

Use o método setTime() para ajudar a atribuir data e hora para outro objeto {{jsxref("Date")}}.

+ +

Exemplos

+ +

Usando setTime()

+ +
var theBigDay = new Date('July 1, 1999');
+var sameAsBigDay = new Date();
+sameAsBigDay.setTime(theBigDay.getTime());
+
+ +

Especificações

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName('ES1')}}{{Spec2('ES1')}}Definição inicial. Implementado no JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.9.5.27', 'Date.prototype.setTime')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-date.prototype.settime', 'Date.prototype.setTime')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-date.prototype.settime', 'Date.prototype.setTime')}}{{Spec2('ESDraft')}} 
+ +

Compatibilidade nos Browsers

+ + + +

{{Compat("javascript.builtins.Date.setTime")}}

+ +

Veja também

+ + -- cgit v1.2.3-54-g00ecf