aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/http
diff options
context:
space:
mode:
authorArtyom Liou <artyomliou@gmail.com>2021-04-30 14:06:25 +0800
committerIrvin <irvinfly@gmail.com>2021-05-01 17:21:19 +0800
commitb0b225dce1707ceda83a9b2779d4de971f2be78a (patch)
tree45efe618ba5b152e44dd2c3323a1e09838e14406 /files/zh-tw/web/http
parent03e2f89170237b85d52ebc867dd3b812a3661d6b (diff)
downloadtranslated-content-b0b225dce1707ceda83a9b2779d4de971f2be78a.tar.gz
translated-content-b0b225dce1707ceda83a9b2779d4de971f2be78a.tar.bz2
translated-content-b0b225dce1707ceda83a9b2779d4de971f2be78a.zip
web/http/headers/date (zh-TW translation)
Diffstat (limited to 'files/zh-tw/web/http')
-rw-r--r--files/zh-tw/web/http/headers/date/index.html105
1 files changed, 105 insertions, 0 deletions
diff --git a/files/zh-tw/web/http/headers/date/index.html b/files/zh-tw/web/http/headers/date/index.html
new file mode 100644
index 0000000000..74cebd36b2
--- /dev/null
+++ b/files/zh-tw/web/http/headers/date/index.html
@@ -0,0 +1,105 @@
+---
+title: Date
+slug: Web/HTTP/Headers/Date
+tags:
+- General Header
+- HTTP
+- Reference
+- header
+---
+<div>{{HTTPSidebar}}</div>
+
+<p><strong><code>Date</code></strong> 標頭的值是傳送當下的日期與時間。</p>
+
+<div class="notecard warning">
+ <p>注意 <code>Date</code> 被列在 fetch spec 的 <a
+ href="https://fetch.spec.whatwg.org/#forbidden-header-name"
+ rel="nofollow noreferrer">forbidden header names</a> 清單中──也就是說這段程式不會送出 <code>Date</code> 標頭:</p>
+
+ <pre class="brush: js">fetch('https://httpbin.org/get', {
+ 'headers': {
+ 'Date': (new Date()).toUTCString()
+ }
+})</pre>
+</div>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">Header type</th>
+ <td>{{Glossary("General header")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">{{Glossary("Forbidden header name")}}</th>
+ <td>yes</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Syntax">語法</h2>
+
+<pre class="brush: html">Date: &lt;day-name&gt;, &lt;day&gt; &lt;month&gt; &lt;year&gt; &lt;hour&gt;:&lt;minute&gt;:&lt;second&gt; GMT
+</pre>
+
+<h2 id="Directives">指令</h2>
+
+<dl>
+ <dt>&lt;day-name&gt;</dt>
+ <dd>代表星期幾,為 Mon、Tue、Wed、Thu、Fri、Sat 或 Sun 之一(區分大小寫)。</dd>
+ <dt>&lt;day&gt;</dt>
+ <dd>二位數日期,比如「04」或「23」。</dd>
+ <dt>&lt;month&gt;</dt>
+ <dd>月份,為 Jan、Feb、Mar、Apr、May、Jun、Jul、Aug、Sep、Oct、Nov、Dec 之一(區分大小寫)。</dd>
+ <dt>&lt;year&gt;</dt>
+ <dd>四位數年份,比如「1990」或「2016」。</dd>
+ <dt>&lt;hour&gt;</dt>
+ <dd>二位數小時,比如「09」或「23」。</dd>
+ <dt>&lt;minute&gt;</dt>
+ <dd>二位數分鐘,比如「04」或「59」。</dd>
+ <dt>&lt;second&gt;</dt>
+ <dd>二位數秒,比如「04」或「59」。</dd>
+ <dt>GMT</dt>
+ <dd>
+ <p>格林威治標準時間的意思。在 HTTP 中日期都是採用 GMT,絕不會顯示當地時間。</p>
+ </dd>
+</dl>
+
+<h2 id="Examples">範例</h2>
+
+<pre>Date: Wed, 21 Oct 2015 07:28:00 GMT
+</pre>
+
+<pre class="brush: js">new Date().toUTCString()
+// "Mon, 09 Mar 2020 08:13:24 GMT"</pre>
+
+<h2 id="Specifications">規格</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Title</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{RFC("7231、Date、7.1.1.2")}}</td>
+ <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">瀏覽器相容性</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("http.headers.Date")}}</p>
+
+<h2 id="See_also">參閱</h2>
+
+<ul>
+ <li>{{HTTPHeader("Age")}}</li>
+</ul>