aboutsummaryrefslogtreecommitdiff
path: root/files/uk/web/javascript/reference/global_objects/date/settime
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:43:23 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:43:23 -0500
commit218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (patch)
treea9ef8ac1e1b8fe4207b6d64d3841bfb8990b6fd0 /files/uk/web/javascript/reference/global_objects/date/settime
parent074785cea106179cb3305637055ab0a009ca74f2 (diff)
downloadtranslated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.tar.gz
translated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.tar.bz2
translated-content-218934fa2ed1c702a6d3923d2aa2cc6b43c48684.zip
initial commit
Diffstat (limited to 'files/uk/web/javascript/reference/global_objects/date/settime')
-rw-r--r--files/uk/web/javascript/reference/global_objects/date/settime/index.html71
1 files changed, 71 insertions, 0 deletions
diff --git a/files/uk/web/javascript/reference/global_objects/date/settime/index.html b/files/uk/web/javascript/reference/global_objects/date/settime/index.html
new file mode 100644
index 0000000000..a7ef57235d
--- /dev/null
+++ b/files/uk/web/javascript/reference/global_objects/date/settime/index.html
@@ -0,0 +1,71 @@
+---
+title: Date.prototype.setTime()
+slug: Web/JavaScript/Reference/Global_Objects/Date/setTime
+tags:
+ - Date
+ - JavaScript
+ - Довідка
+ - метод
+translation_of: Web/JavaScript/Reference/Global_Objects/Date/setTime
+---
+<div>{{JSRef}}</div>
+
+<p>Метод <strong><code>setTime()</code></strong> встановлює об'єкту {{jsxref("Date")}} час, переданий кількістю мілісекунд від 1 січня 1970 року, 00:00:00 за UTC.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/date-settime.html")}}</div>
+
+
+
+<h2 id="Синтаксис">Синтаксис</h2>
+
+<pre class="syntaxbox notranslate"><code><var>dateObj</var>.setTime(<var>timeValue</var>)</code></pre>
+
+<h3 id="Параметри">Параметри</h3>
+
+<dl>
+ <dt><code>timeValue</code></dt>
+ <dd>Ціле число, що відображає кільксть мілісекунд від 1 січня 1970 року, 00:00:00 за UTC.</dd>
+</dl>
+
+<h3 id="Повертає">Повертає</h3>
+
+<p>Кількість мілісекунд між 1 січня 1970 року 00:00:00 за UTC та оновленою датой (власне, значення аргументу).</p>
+
+<h2 id="Опис">Опис</h2>
+
+<p>Використовуйте <code>setTime()</code>, щоб присвоїти дату та час іншому об'єкту {{jsxref("Date")}}.</p>
+
+<h2 id="Приклади">Приклади</h2>
+
+<h3 id="Застосування_setTime">Застосування <code>setTime()</code></h3>
+
+<pre class="brush: js notranslate">var theBigDay = new Date('July 1, 1999');
+var sameAsBigDay = new Date();
+sameAsBigDay.setTime(theBigDay.getTime());
+</pre>
+
+<h2 id="Специфікації">Специфікації</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-date.prototype.settime', 'Date.prototype.setTime')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Сумісність_з_веб-переглядачами">Сумісність з веб-переглядачами</h2>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("javascript.builtins.Date.setTime")}}</p>
+
+<h2 id="Див._також">Див. також</h2>
+
+<ul>
+ <li>{{jsxref("Date.prototype.getTime()")}}</li>
+ <li>{{jsxref("Date.prototype.setUTCHours()")}}</li>
+</ul>