aboutsummaryrefslogtreecommitdiff
path: root/files/uk/web/javascript/reference/global_objects/date/toutcstring
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/toutcstring
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/toutcstring')
-rw-r--r--files/uk/web/javascript/reference/global_objects/date/toutcstring/index.html109
1 files changed, 109 insertions, 0 deletions
diff --git a/files/uk/web/javascript/reference/global_objects/date/toutcstring/index.html b/files/uk/web/javascript/reference/global_objects/date/toutcstring/index.html
new file mode 100644
index 0000000000..077f04aaad
--- /dev/null
+++ b/files/uk/web/javascript/reference/global_objects/date/toutcstring/index.html
@@ -0,0 +1,109 @@
+---
+title: Date.prototype.toUTCString()
+slug: Web/JavaScript/Reference/Global_Objects/Date/toUTCString
+tags:
+ - Date
+ - JavaScript
+ - Довідка
+ - метод
+translation_of: Web/JavaScript/Reference/Global_Objects/Date/toUTCString
+---
+<div>{{JSRef}}</div>
+
+<p>Метод <strong><code>toUTCString()</code></strong> перетворює дату на рядок, використовуючи часовий пояс UTC.</p>
+
+<p>Заснований на <a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.1">rfc7231</a> та змінений згідно з <a href="https://www.ecma-international.org/ecma-262/10.0/index.html#sec-date.prototype.toutcstring">ecma-262 toUTCString</a>, він може мати від'ємні значення у <a href="https://tc39.es/ecma262/#sec-date.prototype.toutcstring">версії 2021</a>.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/date-toutcstring.html","shorter")}}</div>
+
+
+
+<h2 id="Синтаксис">Синтаксис</h2>
+
+<pre class="syntaxbox notranslate"><code><var>dateObj</var>.toUTCString()</code></pre>
+
+<h3 id="Повертає">Повертає</h3>
+
+<p>Рядкове представлення наданої дати з використанням часового поясу UTC.</p>
+
+<h2 id="Опис">Опис</h2>
+
+<p>Значення, яке повертає <code>toUTCString()</code>, є рядком у формі <code><var>Www</var>, <var>dd</var> <var>Mmm</var> <var>yyyy</var> <var>hh</var>:<var>mm</var>:<var>ss</var> GMT</code>, де:</p>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Рядок</th>
+ <th scope="col">Опис</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><code><var>Www</var></code></td>
+ <td>День тижня у вигляді трьох літер (наприклад, Sun, Mon, ...)</td>
+ </tr>
+ <tr>
+ <td><code><var>dd</var></code></td>
+ <td>Двозначний день місяця, з першим нулем, якщо необхідно</td>
+ </tr>
+ <tr>
+ <td><code><var>Mmm</var></code></td>
+ <td>Місяць у вигляді трьох літер (наприклад, Jan, Feb, ...)</td>
+ </tr>
+ <tr>
+ <td><code><var>yyyy</var></code></td>
+ <td>Рік, чотири або більше цифр, з першими нулями, якщо необхідно</td>
+ </tr>
+ <tr>
+ <td><code><var>hh</var></code></td>
+ <td>Години, дві цифри з першим нулем, якщо необхідно</td>
+ </tr>
+ <tr>
+ <td><code><var>mm</var></code></td>
+ <td>Хвилини, дві цифри з першим нулем, якщо необхідно</td>
+ </tr>
+ <tr>
+ <td><code><var>ss</var></code></td>
+ <td>Секунди, дві цифри з першим нулем, якщо необхідно</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>До появи ECMAScript 2018, формат значення, яке поверталось, залежив від платформи. Найпоширенішим варіантом була дата у форматі RFC-1123, що є трохи оновленою версією дати у форматі RFC-822.</p>
+
+<h2 id="Приклади">Приклади</h2>
+
+<h3 id="Використання_toUTCString">Використання <code>toUTCString()</code></h3>
+
+<pre class="brush: js notranslate">let today = new Date('Wed, 14 Jun 2017 00:00:00 PDT');
+let UTCstring = today.toUTCString(); // Wed, 14 Jun 2017 07:00:00 GMT
+</pre>
+
+<h2 id="Специфікації">Специфікації</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Специфікація</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-date.prototype.toutcstring', 'Date.prototype.toUTCString')}}</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.toUTCString")}}</p>
+
+<h2 id="Див._також">Див. також</h2>
+
+<ul>
+ <li>{{jsxref("Date.prototype.toLocaleString()")}}</li>
+ <li>{{jsxref("Date.prototype.toDateString()")}}</li>
+ <li>{{jsxref("Date.prototype.toISOString()")}}</li>
+</ul>