HTML CSS Bootstrap Javascript Icons Python
HTML References
HTML - Tag Reference HTML - Tag by Category HTML - Attributes HTML - Global Attributes HTML - Events HTML - Language Codes HTML - Country Codes HTML - URL Encoding HTTP Methods HTTP Status Codes <input> types
All HTML Tags
<!-- --> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <time> tag

The HTML <time> element represents a specific period in time.

It may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders.

Run code

Note: The time element does not render as anything special in any of the major browsers.

Browser compatibility

The numbers in the table specify the first browser version that fully supports the <time> element:

Element
<time> 6 4 11.1 5 9



Attributes

The following table shows the attributes that are specific to the <time> tag:

Attribute Value Description
datetime time-stamp This attribute indicates the time and/or date of the element and must be in one of the formats described below

Global Attributes

The <time> tag supports the global attributes described in HTML Global Attributes Reference

Event Attributes

The <time> tag supports the event attributes described in HTML Events Reference

Valid datetime Values

a valid year string

2018

a valid month string

2018-09

a valid date string

2018-09-26

a valid time string

15:30

15:30:42

15:30:42.784

a valid local date and time string

2018-09-26T15:30:42.784

2018-09-26 15:30:42.784

Tags: Reference

Last updated: Monday 01 Oct, 2018