-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
39 lines (26 loc) · 882 Bytes
/
index.md
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
---
title: "HTMLTimeElement: dateTime property"
short-title: dateTime
slug: Web/API/HTMLTimeElement/dateTime
page-type: web-api-instance-property
browser-compat: api.HTMLTimeElement.dateTime
---
{{ APIRef("HTML DOM") }}
The
**`HTMLTimeElement.dateTime`**
property is a string that reflects the [`datetime`](/en-US/docs/Web/HTML/Element/time#datetime) HTML attribute, containing a machine-readable form of the element's date and
time value.
## Value
A string. For valid string formats, see the [`datetime` valid values](/en-US/docs/Web/HTML/Element/time#valid_datetime_values).
## Examples
```js
// Assumes there is <time id="t"> element in the HTML
const t = document.getElementById("t");
t.dateTime = "6w 5h 34m 5s";
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- The {{domxref("HTMLTimeElement")}} interface it belongs to.