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 --- .../reference/global_objects/date/now/index.html | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/date/now/index.html (limited to 'files/ca/web/javascript/reference/global_objects/date/now') diff --git a/files/ca/web/javascript/reference/global_objects/date/now/index.html b/files/ca/web/javascript/reference/global_objects/date/now/index.html new file mode 100644 index 0000000000..c3ef05fa86 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/date/now/index.html @@ -0,0 +1,126 @@ +--- +title: Date.now() +slug: Web/JavaScript/Referencia/Objectes_globals/Date/now +translation_of: Web/JavaScript/Reference/Global_Objects/Date/now +--- +
{{JSRef("Global_Objects", "Date")}}
+ +

Resum

+ +

El mètode Date.now() retorna el nombre de milisegons que han passat des de l'1 de gener de 1970 00:00:00 UTC.

+ +

Sintaxi

+ +
var timeInMs = Date.now();
+ +

Paràmetres

+ +

Cap.

+ +

Descripció

+ +

El mètode now() retorna el nombre de method returns el nombre de milisegons que han passat des de l'1 de gener de 1970 00:00:00 UTC fins al moment actual representat en un  {{jsxref("Global_Objects/Number", "Nombre")}}.

+ +

Com que now() és un mètode estàtic de {{jsxref("Global_Objects/Date", "Date")}}, sempre es crida com a Date.now().

+ +

Polyfill

+ +

Aquest mètode va ser estandaritzat a la cinquena edició de l'ECMA-262. Els motors que encara no hagin sigut actualitzats per a suportar aquest mètode poden utilitzar el bocí de codi següent per a paliar l'absència d'aquest mètode:

+ +
if (!Date.now) {
+  Date.now = function now() {
+    return new Date().getTime();
+  };
+}
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES5.1', '#sec-15.9.4.4', 'Date.now')}}{{Spec2('ES5.1')}}Definició inicial. Implementat a JavaScript 1.5.
{{SpecName('ES6', '#sec-date.now', 'Date.now')}}{{Spec2('ES6')}} 
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterístiquesChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatChrome("5")}}{{CompatGeckoDesktop("1.9")}}{{CompatIE("9")}}{{CompatOpera("10.50")}}{{CompatSafari("4")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterístiquesAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
+ + + + + + +
Suport bàsic
+
{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Basat en la  taula de compatibilitat de Kangax.

+ +

Vegeu també

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