- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML
The <time> element in HTML is used to set and display date and time on a webpage. This tag introduced in HTML5.
Following is the attribute −
- datetime: The date-time to be displayed.
Let us now see an example to implement the <time> tag in HTML −
Example
<!DOCTYPE html> <html> <body> <h2>Schedule</h2> <p>Exams begins from next <time datetime="06-15">Saturday</time>.</p> <p>Exam begins at <time>09:00</time> in the morning.</p> </body> </html>
Output
In the above example, we have set the date and time using the <time> element −
<p>Exams begins from next <time datetime="06-15">Saturday</time>.</p>
To set only the time, use the <time> element as shown below −
<p>Exam begins at <time>09:00</time> in the morning.</p>
Advertisements