From cb9e359a51c3249d8f5157db69d43fd413ddeda6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:45:12 +0100 Subject: unslug ca: move --- .../global_objects/date/gethours/index.html | 120 +++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/date/gethours/index.html (limited to 'files/ca/web/javascript/reference/global_objects/date/gethours/index.html') diff --git a/files/ca/web/javascript/reference/global_objects/date/gethours/index.html b/files/ca/web/javascript/reference/global_objects/date/gethours/index.html new file mode 100644 index 0000000000..3848e96339 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/date/gethours/index.html @@ -0,0 +1,120 @@ +--- +title: Date.prototype.getHours() +slug: Web/JavaScript/Referencia/Objectes_globals/Date/getHours +translation_of: Web/JavaScript/Reference/Global_Objects/Date/getHours +--- +
{{JSRef("Global_Objects", "Date")}}
+ +

Resum

+ +

El mètode getHours() retorna l'hora per a la data especificada, en temps local.

+ +

Sintaxi

+ +
dateObj.getHours()
+ +

Paràmetres

+ +

Cap.

+ +

Retorna

+ +

El valor retornat per getHours() és un nombre sencer entre 0 i 23.

+ +

Exemples

+ +

Exemple: Utilitzar getHours()

+ +

La segona sentència que trobareu a continuació assigna el valor 23 a la variable hora, basant-se en l'objecte {{jsxref("Global_Objects/Date", "Date")}} nadal95.

+ +
var nadal95 = new Date('December 25, 1995 23:15:30');
+var hora = nadal95.getHours();
+
+console.log(hora); // 23
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
ECMAScript 1a Edició.StandardDefinició inicial. Implementat a JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.9.5.18', 'Date.prototype.getHours')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-date.prototype.gethours', 'Date.prototype.getHours')}}{{Spec2('ES6')}} 
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

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