aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/html/element/time/index.html
blob: 9c613b7bb6406e9fc2d735816d00ae033ce5be20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
title: <time>
slug: Web/HTML/Element/time
translation_of: Web/HTML/Element/time
---
<h2 id="Resumo">Resumo</h2>

<p>O elemento HTML <em>time</em> <span style="line-height: inherit;">(</span><code style="font-size: 14px; line-height: inherit;">&lt;time&gt;</code><span style="line-height: inherit;">) representa o tempo tanto no formato de 24 horas ou como uma data precisa no calendário Gregoriano (com informações </span><span style="line-height: inherit;">opcionais </span><span style="line-height: inherit;">de tempo e fuso horário)</span></p>

<p>Este elemento é destinado a apresentar datas e horas no dispositivo em um formato legível<span style="line-height: inherit;">. Isto pode ser útil aos agentes do usuário em oferecer qualquer programação de eventos ao calendário do utilizador.</span></p>

<div class="note"><strong>Notas de uso:</strong> Este elemento não é adequado por exemplo, quando uma data específica não pode ser calculada, e nem deveria ser utilizado em datas anteriores ao calendário Gregoriano (devido as complicações com os cálculos dessas datas).</div>

<div class="note"><strong>Nota de estatus:</strong> Este elemento foi concebido e está em discussão desde 2011 (<a class="external" href="http://blog.whatwg.org/weekly-time-data" title="http://blog.whatwg.org/weekly-time-data">http://blog.whatwg.org/weekly-time-data</a><span style="line-height: 1.5em;">)</span></div>

<h2 id="Contexto_de_uso">Contexto de uso</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <td><a href="/en-US/docs/HTML/Content_categories" title="HTML/Content categories">Categorias de conteúdo</a></td>
   <td><a href="/en-US/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">flow content</a>, <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content categories#Phrasing content">phrasing content</a></td>
  </tr>
  <tr>
   <td>Permitted content</td>
   <td><a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content categories#Phrasing content">Phrasing content</a>, but no descendant <code>time</code> elements.</td>
  </tr>
  <tr>
   <td>Tag omission</td>
   <td>None, both the start tag and the end tag are mandatory.</td>
  </tr>
  <tr>
   <td>Permitted parent elements</td>
   <td>Any element that accepts phrasing content.</td>
  </tr>
  <tr>
   <td>Normative document</td>
   <td><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-time-element" rel="external nofollow" title="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-time-element">HTML5, section 4.6.10</a></td>
  </tr>
 </tbody>
</table>

<h2 id="Atributos">Atributos</h2>

<p>Como todo outro elemento HTML, este elemento suporta os <a href="/en-US/docs/HTML/Global_attributes">atributos globais</a>.</p>

<dl>
 <dt>{{htmlattrdef("datetime")}}</dt>
 <dd>Esse atributo indica a hora e a data do elemento e deve ser uma data válida com uma string de tempo opcional. Se o valor não puder ser analisado como uma data com uma string de tempo opcional, o elemento não possui um timestamp associado.</dd>
 <dt>{{htmlattrdef("pubdate")}}</dt>
 <dd>(This feature is still being discussed by the WHATWG and the W3C HTML5 Working Group.) This Boolean attribute specifies that the date and time given by the element is the publication date of a document. The document it applies to is either the nearest ancestor article element or the document as a whole (if there is no ancestor <a href="/en-US/docs/HTML/Element/article" title="HTML/Element/Article">article</a> element). If true, the <code>time</code> element must have a corresponding date. Additionally, each <code>time</code> element indicating a publication date must be the only <code>time</code> element that does so for that document.</dd>
</dl>

<h2 id="DOM_interface">DOM interface</h2>

<p>This element implements the <code><a href="/en-US/docs/DOM/HTMLTimeElement" title="DOM/HTMLTimeElement">HTMLTimeElement</a></code> interface.</p>

<h2 id="Exemplos">Exemplos</h2>

<h3 id="Simple_example" name="Simple_example">Simple example</h3>

<pre class="brush: html">&lt;p&gt;The concert starts at &lt;time&gt;20:00&lt;/time&gt;.&lt;/p&gt;
</pre>

<p>Above HTML will output:</p>

<p>The concert starts at 20:00.</p>

<h3 id="Pubdate_example" name="Pubdate_example"><code>pubdate</code> example</h3>

<pre class="brush: html">&lt;article&gt;
  &lt;p&gt;This article was created on &lt;time pubdate&gt;2011-01-28&lt;/time&gt;.&lt;/p&gt;
&lt;/article&gt;
</pre>

<p>Above HTML will output:</p>

<p>This article was created on 2011-01-28.</p>

<h3 id="Datetime_example" name="Datetime_example"><code>datetime</code> example</h3>

<pre class="brush: html">&lt;p&gt;The concert took place on &lt;time datetime="2001-05-15 19:00"&gt;May 15&lt;/time&gt;.&lt;/p&gt;
</pre>

<p>Above HTML will output:</p>

<p>The concert took place on May 15.</p>

<h2 id="Compatibilidade">Compatibilidade</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatNo}} {{bug("629801")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>11.50</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="See_also" name="See_also">Veja também</h2>

<ul>
 <li><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#the-time-element" title="http://www.whatwg.org/specs/web-apps/current-work/#the-time-element">The <code>time</code> element</a> (HTML5 specification)</li>
</ul>

<p> </p>