TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML time tag

HTML time tag with examples, html5, forms, input, text, anchor, image, heading, marquee, textarea, paragraph, title, quotes, code etc.

<< Back to HTML

HTML Time Tag

HTML <time> tag is used to define date and time. It displays time value in a 24 hour clock or a precise date in a Gregorian calendar in HTML.

It is used to encode dates and times in a machine-readable way to make easy to mark or schedule your task.

It also helps search engines to produce smarter search results.

HTML <time> is a new tag and introduced in HTML5.

Let's see the syntax to define date and time.

<time>Define Time and Date here</time>

Attribute

There is only one specific attribute of HTML5 time tag.

AttributeDescription
datetimeIt is used to define machine-readable date/time within the time element.

HTML time tag example

<p>We open our shop at <time>09:00</time> am.</p>
<p>The business meeting is scheduled on <time datetime="2009-02-18">next wednesday</time>.</p>
<p>The wedding of Salman's sister was scheduled  at <time datetime="2014-11-19 T0 7:00-09:00">7pm last wednesday </time>.</p>
Test it Now

Output:

We open our shop at am.

The business meeting is scheduled on .

The wedding of Salman's sister was scheduled at .


In this example, First line in the body tag defines basic usage of time tag.

Second line shows how to use the datetime attribute to provide contents in a machine-readable format.

Third line uses the datetime attribute to provide an even more specific date and time.


The <time> tag also supports global attributes and event attributes in HTML 5.


Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<time>YesYesYesYesYes
Next TopicHTML title Tag




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf