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/getday/index.html | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 files/pt-br/web/javascript/reference/global_objects/date/getday/index.html (limited to 'files/pt-br/web/javascript/reference/global_objects/date/getday') diff --git a/files/pt-br/web/javascript/reference/global_objects/date/getday/index.html b/files/pt-br/web/javascript/reference/global_objects/date/getday/index.html new file mode 100644 index 0000000000..594f2aa427 --- /dev/null +++ b/files/pt-br/web/javascript/reference/global_objects/date/getday/index.html @@ -0,0 +1,127 @@ +--- +title: Date.prototype.getDay() +slug: Web/JavaScript/Reference/Global_Objects/Date/getDay +tags: + - Date + - JavaScript + - Method + - Prototype + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay +--- +
{{JSRef("Global_Objects", "Date")}}
+ +

Resumo

+ +

O método getDay() retorna o dia da semana para a data especificada de acordo com a hora local, onde 0 representa o Domingo.

+ +

Sintaxe

+ +
dateObj.getDay()
+ +

Parâmetros

+ +

Nenhum.

+ +

Retorna

+ +

O valor retornado por getDay() é um inteiro que corresponde com o dia da semana: 0 para Domingo, 1 para Segunda-Feira, 2 para Terça-Feira, e assim por diante.

+ +

Exemplos

+ +

Exemplo: Usando getDay()

+ +

O segundo statement abaixo atribui o valor 1 à variável weekday (dia da semana), baseado no valor do objeto {{jsxref("Global_Objects/Date", "Date")}} Xmas95. A data 25 de Dezembro de 1995 é uma Segunda-Feira.

+ +
var Xmas95 = new Date('December 25, 1995 23:15:30');
+var weekday = Xmas95.getDay();
+
+console.log(weekday); // 1
+
+ +

Especificações

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
ECMAScript 1st Edition.StandardDefinição inicial. Implementado em JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.9.5.16', 'Date.prototype.getDay')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-date.prototype.getday', 'Date.prototype.getDay')}}{{Spec2('ES6')}} 
+ +

Compatibilidade com browsers

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Veja também

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