Categories
HTML

time Element

  1. Introduction
  2. Attributes

Introduction

The <time> HTML 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.


Attributes

datetime

  • A time on a 24-hour clock
    • a valid time string:
      • 14:54
      • 14:54:39
      • 14:54:39.929
  • A precise date
    • a valid year string
      • 2023
    • a valid month string
      • 2023-04
    • a valid date string
      • 2023-04-27
    • a valid yearless date string
      • 04-27
    • a valid week string
      • 2023-W16
    • a valid local date and time string
      • 2011-11-18T14:54:39.929
      • 2011-11-18 14:54:39.929
    • a valid global date and time string
      • 2011-11-18T14:54:39.929Z
      • 2011-11-18T14:54:39.929-0400
      • 2011-11-18T14:54:39.929-04:00
      • 2011-11-18 14:54:39.929Z
      • 2011-11-18 14:54:39.929-0400
      • 2011-11-18 14:54:39.929-04:00
  • A valid time duration
    • a valid duration string
      • PT4H18M3S

Leave a comment