aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/javascript/reference/global_objects/date
diff options
context:
space:
mode:
Diffstat (limited to 'files/ru/web/javascript/reference/global_objects/date')
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/getdate/index.html4
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/getday/index.html6
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/getfullyear/index.html4
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/gethours/index.html4
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/getmilliseconds/index.html4
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/getminutes/index.html4
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/getmonth/index.html4
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/getseconds/index.html4
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/gettime/index.html6
-rw-r--r--files/ru/web/javascript/reference/global_objects/date/index.html14
10 files changed, 27 insertions, 27 deletions
diff --git a/files/ru/web/javascript/reference/global_objects/date/getdate/index.html b/files/ru/web/javascript/reference/global_objects/date/getdate/index.html
index 52e0d9eefa..9c6667995c 100644
--- a/files/ru/web/javascript/reference/global_objects/date/getdate/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/getdate/index.html
@@ -17,7 +17,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDate
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getDate()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getDate()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDate
<p>Вторая инструкция в примере ниже присваивает значение 25 переменной <code>day</code> из значения объекта {{jsxref("Global_Objects/Date", "Date")}} <code>date</code>.</p>
-<pre class="brush: js notranslate">let date = new Date('December 25, 1995 23:15:30');
+<pre class="brush: js">let date = new Date('December 25, 1995 23:15:30');
let day = date.getDate();
console.log(day); // 25
diff --git a/files/ru/web/javascript/reference/global_objects/date/getday/index.html b/files/ru/web/javascript/reference/global_objects/date/getday/index.html
index 654e43455f..c2c2bd4e8a 100644
--- a/files/ru/web/javascript/reference/global_objects/date/getday/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/getday/index.html
@@ -17,7 +17,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getDay()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getDay()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay
<p>Вторая инструкция в примере ниже присваивает значение 1 переменной <code>weekday</code> из значения объекта {{jsxref("Global_Objects/Date", "Date")}} <code>date</code>. 25 декабря 1995 года было понедельником.</p>
-<pre class="brush: js notranslate">let date = new Date('December 25, 1995 23:15:30');
+<pre class="brush: js">let date = new Date('December 25, 1995 23:15:30');
let weekday = date.getDay();
console.log(weekday); // 1
@@ -42,7 +42,7 @@ console.log(weekday); // 1
<div class="blockIndicator note">
<p><strong>Примечание:</strong> При необходимости полное название дня (например, "<code>Понедельник</code>") можно получить, используя {{jsxref("DateTimeFormat", "Intl.DateTimeFormat")}} с параметром <code>options</code> parameter. С помощью этого метода упрощается интернационализация:</p>
-<pre class="brush: js notranslate">let options = { weekday: 'long'};
+<pre class="brush: js">let options = { weekday: 'long'};
console.log(new Intl.DateTimeFormat('en-US', options).format(date));
// Monday
diff --git a/files/ru/web/javascript/reference/global_objects/date/getfullyear/index.html b/files/ru/web/javascript/reference/global_objects/date/getfullyear/index.html
index 5a7d09c7bf..60aeb1a1ac 100644
--- a/files/ru/web/javascript/reference/global_objects/date/getfullyear/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/getfullyear/index.html
@@ -19,7 +19,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getFullYear()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getFullYear()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -35,7 +35,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear
<p>В следующем примере переменной <code>year</code> присваивается четырёхзначное значение текущего года.</p>
-<pre class="brush: js notranslate">let today = new Date(); // Mon Nov 23 2020 15:23:46 GMT+0300 (Москва, стандартное время)
+<pre class="brush: js">let today = new Date(); // Mon Nov 23 2020 15:23:46 GMT+0300 (Москва, стандартное время)
let year = today.getFullYear(); // 2020
</pre>
diff --git a/files/ru/web/javascript/reference/global_objects/date/gethours/index.html b/files/ru/web/javascript/reference/global_objects/date/gethours/index.html
index 4e927a3454..2f0c788d1a 100644
--- a/files/ru/web/javascript/reference/global_objects/date/gethours/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/gethours/index.html
@@ -17,7 +17,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getHours
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getHours()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getHours()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getHours
<p>Вторая инструкция в примере ниже присваивает значение 23 переменной <code>hours</code> из значения объекта {{jsxref("Global_Objects/Date", "Date")}} <code>date</code>.</p>
-<pre class="brush: js notranslate">let date = new Date('December 25, 1995 23:15:30');
+<pre class="brush: js">let date = new Date('December 25, 1995 23:15:30');
let hours = date.getHours();
console.log(hours); // 23
diff --git a/files/ru/web/javascript/reference/global_objects/date/getmilliseconds/index.html b/files/ru/web/javascript/reference/global_objects/date/getmilliseconds/index.html
index 4d848fc5e8..3d9d51b204 100644
--- a/files/ru/web/javascript/reference/global_objects/date/getmilliseconds/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/getmilliseconds/index.html
@@ -17,7 +17,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getMilliseconds()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getMilliseconds()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds
<p>В следующем примере переменной <code>milliseconds</code> присваиваются миллисекунды текущего времени:</p>
-<pre class="brush: js notranslate">let today = new Date();
+<pre class="brush: js">let today = new Date();
let milliseconds = today.getMilliseconds();
console.log(milliseconds); // 709
diff --git a/files/ru/web/javascript/reference/global_objects/date/getminutes/index.html b/files/ru/web/javascript/reference/global_objects/date/getminutes/index.html
index 533cba2dc5..0b97f5e1f7 100644
--- a/files/ru/web/javascript/reference/global_objects/date/getminutes/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/getminutes/index.html
@@ -17,7 +17,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMinutes
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getMinutes()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getMinutes()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMinutes
<p>Вторая инструкция в примере ниже присваивает значение 15 переменной <code>minutes</code> из значения объекта {{jsxref("Global_Objects/Date", "Date")}} <code>date</code>.</p>
-<pre class="brush: js notranslate">let date = new Date('December 25, 1995 23:15:30');
+<pre class="brush: js">let date = new Date('December 25, 1995 23:15:30');
let minutes = date.getMinutes();
console.log(minutes); // 15
diff --git a/files/ru/web/javascript/reference/global_objects/date/getmonth/index.html b/files/ru/web/javascript/reference/global_objects/date/getmonth/index.html
index 5b42ea933a..001f258a2c 100644
--- a/files/ru/web/javascript/reference/global_objects/date/getmonth/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/getmonth/index.html
@@ -17,7 +17,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMonth
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getMonth()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getMonth()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getMonth
<p>Вторая инструкция в примере ниже присваивает значение 11 переменной <code>month</code> из значения переменной <code>date</code> объекта {{jsxref("Global_Objects/Date", "Date")}}.</p>
-<pre class="brush: js notranslate">let date = new Date('December 25, 1995 23:15:30');
+<pre class="brush: js">let date = new Date('December 25, 1995 23:15:30');
let month = date.getMonth();
console.log(month); // 11
diff --git a/files/ru/web/javascript/reference/global_objects/date/getseconds/index.html b/files/ru/web/javascript/reference/global_objects/date/getseconds/index.html
index 6027da393b..e2e5fecaac 100644
--- a/files/ru/web/javascript/reference/global_objects/date/getseconds/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/getseconds/index.html
@@ -17,7 +17,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getSeconds
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getSeconds()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getSeconds()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getSeconds
<p>Вторая инструкция в примере ниже присваивает значение 30 переменной <code>seconds</code> из значения переменной <code>date</code> объекта {{jsxref("Global_Objects/Date", "Date")}}.</p>
-<pre class="brush: js notranslate">let date = new Date('December 25, 1995 23:15:30');
+<pre class="brush: js">let date = new Date('December 25, 1995 23:15:30');
let seconds = date.getSeconds();
console.log(seconds); // 30
diff --git a/files/ru/web/javascript/reference/global_objects/date/gettime/index.html b/files/ru/web/javascript/reference/global_objects/date/gettime/index.html
index 8f380c6208..f4b2c740b6 100644
--- a/files/ru/web/javascript/reference/global_objects/date/gettime/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/gettime/index.html
@@ -23,7 +23,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getTime
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code><var>dateObj</var>.getTime()</code></pre>
+<pre class="syntaxbox"><code><var>dateObj</var>.getTime()</code></pre>
<h3 id="Parameters">Параметры</h3>
@@ -39,7 +39,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date/getTime
<p>Конструирует новый объект даты с идентичным значением времени.</p>
-<pre class="brush: js notranslate">let birthday = new Date(2020, 12, 20);
+<pre class="brush: js">let birthday = new Date(2020, 12, 20);
let copy = new Date();
copy.setTime(birthday.getTime());
@@ -50,7 +50,7 @@ console.log(copy.setTime(birthday.getTime())); // 1611090000000
<p>Вычитанием двух последовательных вызовов метода <code>getTime()</code> на заново сконструированных объектах {{jsxref("Global_Objects/Date", "Date")}} можно замерить промежуток времени, произошедший между двумя этими вызовами. Это можно использовать для вычисления времени выполнения неких операций.</p>
-<pre class="brush: js notranslate">let end, start;
+<pre class="brush: js">let end, start;
start = new Date();
for (let i = 0; i &lt; 1000; i++) {
diff --git a/files/ru/web/javascript/reference/global_objects/date/index.html b/files/ru/web/javascript/reference/global_objects/date/index.html
index bf3ce884dd..0f8ddf6b79 100644
--- a/files/ru/web/javascript/reference/global_objects/date/index.html
+++ b/files/ru/web/javascript/reference/global_objects/date/index.html
@@ -24,7 +24,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Date
<h2 id="Syntax">Синтаксис</h2>
-<pre class="syntaxbox notranslate"><code>new Date();
+<pre class="syntaxbox"><code>new Date();
new Date(<var>value</var>);
new Date(<var>dateString</var>);
new Date(<var>year</var>, <var>month</var>[, <var>day</var>[, <var>hour</var>[, <var>minute</var>[, <var>second</var>[, <var>millisecond</var>]]]]]);
@@ -118,7 +118,7 @@ new Date(<var>year</var>, <var>month</var>[, <var>day</var>[, <var>hour</var>[,
<p><strong>Обратите внимание:</strong> разбор строкового представления дат с помощью конструктора <code>Date</code> (так же как эквивалентный ему метод <code>Date.parse</code>) может иметь различия и несоответствия в браузерах.</p>
</div>
-<pre class="brush: js notranslate">var today = new Date();
+<pre class="brush: js">var today = new Date();
var birthday = new Date('December 17, 1995 03:24:00');
var birthday = new Date('1995-12-17T03:24:00');
var birthday = new Date(1995, 11, 17);
@@ -129,7 +129,7 @@ var birthday = new Date(1995, 11, 17, 3, 24, 0);
<p>Для того, чтобы создать и получить даты между 0 и 99 годом, нужно использовать методы {{jsxref("Date.prototype.setFullYear()")}} и {{jsxref("Date.prototype.getFullYear()")}}.</p>
-<pre class="brush: js notranslate">var date = new Date(98, 1); // Sun Feb 01 1998 00:00:00 GMT+0000 (GMT)
+<pre class="brush: js">var date = new Date(98, 1); // Sun Feb 01 1998 00:00:00 GMT+0000 (GMT)
// Устаревший метод, 98 отображается на 1998 год
date.setYear(98); // Sun Feb 01 1998 00:00:00 GMT+0000 (GMT)
@@ -141,7 +141,7 @@ date.setFullYear(98); // Sat Feb 01 0098 00:00:00 GMT+0000 (BST)
<p>Следующие примеры показывают, как определить разницу во времени между двумя датами в JavaScript:</p>
-<pre class="brush: js notranslate">// Используя объекты Date
+<pre class="brush: js">// Используя объекты Date
var start = Date.now();
// Событие, для которого замеряется время, происходит тут:
@@ -150,7 +150,7 @@ var end = Date.now();
var elapsed = end - start; // затраченное время в миллисекундах
</pre>
-<pre class="brush: js notranslate">// Используя встроенные методы
+<pre class="brush: js">// Используя встроенные методы
var start = new Date();
// Событие, для которого замеряется время, происходит тут:
@@ -159,7 +159,7 @@ var end = new Date();
var elapsed = end.getTime() - start.getTime(); // затраченное время в миллисекундах
</pre>
-<pre class="brush: js notranslate">// Проверяет функцию и возвращает её возвращаемое значение
+<pre class="brush: js">// Проверяет функцию и возвращает её возвращаемое значение
function printElapsedTime(fTest) {
var nStartTime = Date.now(),
vReturn = fTest(),
@@ -179,7 +179,7 @@ yourFunctionReturn = printElapsedTime(yourFunction);
<h3 id="Получить_количество_секунд_с_начала_эпохи_Unix">Получить количество секунд с начала эпохи Unix</h3>
-<pre class="notranslate"><code>var seconds = Math.floor(Date.now() / 1000);</code></pre>
+<pre><code>var seconds = Math.floor(Date.now() / 1000);</code></pre>
<p>В этом случае важно возвращать только целое число (так что простое деление не подойдёт), а также возвращать только фактически прошедшие секунды (поэтому этот код использует {{jsxref ("Math.floor ()")}} а не {{jsxref ("Math.round ()")}}).</p>