w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



datetime attribute: del datetime, ins datetime

The datetime attribute on the del element:

The datetime attribute on the ins element:

Steps

the date must be a valid date string:
YYYY-MM-DD
year-month-day
2013-03-23

the time must be a valid time string:
hh:mm:ss
hour:minutes:seconds
09:14:13

between date and time can be: space or T
YYYY-MM-DD hh:mm:ss
OR
YYYY-MM-DDThh:mm:ss

add time zone:
a) using Z (if time zone is UTC):
Z = Zulu Time = UTC Time = GMT Time (Greenwich Mean Time) = the time at the Prime Meridian (0 degrees longitude)
cities that use Z time: London, Dublin, Edinburgh...

b) or using + or -: for GMT+⁄UTC+ or GMT-⁄UTC-

EXAMPLES:
You made a change on 29 of March, 2013, at 9AM and 00 minutes and you are:

A) in London (uses UTC → we will use Z) or in places that use London time, then you can write it like this:
using Z:
datetime="2013-03-29T09:00Z" which means 9AM in London
datetime="2013-03-29 09:00Z" which means 9AM in London

B) elswhere, e.g. Berlin: Berlin is 1h EST of Z (Greenwich) → GMT+1 (UTC+1), then you can write it like this:
using + :
datetime="2013-03-29T09:00+01:00" which means 9AM in Berlin, CET time zone
datetime="2013-03-29 09:00+01:00" which means 9AM in Berlin, CET time zone
datetime="2013-03-29T09:00+02:00" which means 9AM in Berlin, CEST time zone (during DST = daylight saving time)
datetime="2013-03-29 09:00+02:00" which means 9AM in Berlin, CEST time zone (during DST = daylight saving time)

C) elswhere, e.g. Azores Islands: Azores is 1h WEST of Z (Greenwich) → GMT-1 (UTC-1), then you can write it like this:
using - :
datetime="2013-03-29T09:00-01:00" which means 9AM in Azores, AZOST time zone
datetime="2013-03-29 09:00-01:00" which means 9AM in Azores, AZOST time zone
datetime="2013-03-29T09:00" which means 9AM in Azores, Azore time (during DST = daylight saving time)
datetime="2013-03-29 09:00" which means 9AM in Azores, Azore time (during DST = daylight saving time)

Examples

<insattribute="value(s)">...<⁄ins>Examples
2.datetime=YYYY-MM-DD

YYYY-MM-DD hh:mmZ
YYYY-MM-DD hh:mm+hh
YYYY-MM-DD hh:mm+hh:mm
YYYY-MM-DD hh:mm-hh
YYYY-MM-DD hh:mm-hh:mm

YYYY-MM-DD hh:mm:ssZ
YYYY-MM-DD hh:mm:ss+hh
YYYY-MM-DD hh:mm:ss+hh:mm
YYYY-MM-DD hh:mm:ss-hh
YYYY-MM-DD hh:mm:ss-hh:mm

YYYY-MM-DDThh:mmZ
YYYY-MM-DDThh:mm+hh
YYYY-MM-DDThh:mm+hh:mm
YYYY-MM-DDThh:mm-hh
YYYY-MM-DDThh:mm-hh:mm

YYYY-MM-DD hh:mm:ssZ
YYYY-MM-DD hh:mm:ss+hh
YYYY-MM-DD hh:mm:ss+hh:mm
YYYY-MM-DD hh:mm:ss-hh
YYYY-MM-DD hh:mm:ss-hh:mm

YYYY-MM-DDThh:mm:ssZ
YYYY-MM-DDThh:mm:ss+hh
YYYY-MM-DDThh:mm:ss+hh:mm
YYYY-MM-DDThh:mm:ss-hh
YYYY-MM-DDThh:mm:ss-hh:mm
<del datetime="2013-03-28T04:23:14Z"> ... <⁄del>
<ins datetime="2013-03-28T04:29:14Z"> ... <⁄ins>

Video demonstration del, ins tags: datetime attribute

HTML5 datetime attribute on del, ins Tutorial

min video details
00:00 video tutorial: datetime attribute on del and ins elements
00:05 datetime attribute allows you to specify the date and optionally the time when you marked the content as inserted or deleted
00:12 the date: must be a valid date string: YYYY-MM-DD
the time: must be a valid time string: hh-mm-ss
00:17 taking this example: let's add datetime to del element; in the same way can be done for ins element also
00:26 date: YYYY-MM-DD stands for: year-month-day
00:33 space or T between date and time if you decide to add the time too
00:37 time: hh:mm:ss stands for: hour:minutes:seconds
00:46 if you're on London time, you can use Z as Z = Zulu Time = UTC Time = GMT Time (Greenwich Mean Time)
00:51 if you're NOT on London time, you could use + or - :
+ for GMT+x where x = hours Est of Greenwich, or Z
- for GMT-x where x = hours West of Greenwich, or Z
00:57 example:
-01:00 means GMT-1 → you could be in Azores Islands
01:03 example:
+01:00 means GMT+1 → you could be in Berlin
ins intro ins browser display ins parents - children ins transparent content model ins syntax ins, del, cite attribute