Global Dates and Times in HTML
Microsyntax Dates and Times in HTML – Part 4
Foreword: In this part of the series, I talk about global dates and global times in HTML; I also talk about vaguer moments in time.
By: Chrysanthus Date Published: 1 Jul 2015
Introduction
Global Dates and Times
A global date and time or global datetime is a datetime taking into consideration the time zone offset. Here, you have a non-normalized and a normalized global datetime.
A global date and time consists of a specific date, consisting of a year, a month, and a day of the month, and a time, consisting of an hour, a minute, a second, and a fraction of a second, expressed with a time-zone offset, consisting of a signed number of hours and minutes.
A string is a valid global date and time string representing a date, time, and a time-zone offset if it consists of the following components in the given order:
A valid date string representing the date; no space, a T character or a SPACE character; no space, a valid time string representing the time; no space, a valid time-zone offset string representing the time-zone offset.
A string is a valid normalized forced-UTC global date and time string representing a date, time, and a time-zone offset if it consists of the following components in the given order:
A valid date string representing the date converted to the UTC time zone; no space, a T character; no space, a valid time string representing the time converted to the UTC time zone and expressed as the shortest possible string for the given time (e.g. omitting the seconds component entirely if the given time is zero seconds past the minute); no space, a Z character. The Z is in uppercase.
You are likely to be using the normalized datetime than the non-normalized datetime.
An example of a microsyntax non-normalized global date and time is:
1979-10-14 12:00:00.001-04:00
A non-normalized time zone offset begins with a + or – sign and does not end with Z. This is followed by two digits for the hour, followed by : and then two digits for the minute.
An example of a valid microsyntax normalized global date and time is:
0037-12-13T00:00Z
Here, you have the date, and then the hours and minutes for the time. Whenever you see Z, it means the subtraction or addition for the time-zone offset has already been done. This is the local datetime, which is the datetime in your country when you are in your country.
Another example of a non-normalized global datetime is:
8592-01-01 02:09:35+02:09
This is time in the future (with time-zone offset relative to Britain).
Note: the difference between a floating datetime and a global datetime is that the floating datetime does not have a time-zone offset.
Vaguer moments in time
“Vaguer moments in time” refers to moments in time that are more vague. Here is the description from the HTML5 specification:
A string is a valid date string with optional time if it is also one of the following:
- A valid date string
- A valid global date and time string
That is it for this part of the series. We stop here and continue in the next part.
Chrys
Related Links
Basics of HTML 5Basics of ECMAScript
HTML DOM Basics
CSS Basics
Text Elements in HTML
Grouping Content
Microsyntax Dates and Times in HTML
Sectioning Content
Common Idioms without Dedicated Elements
HTML Embedded Content
HTML Insecurities and Prevention
Presentation Mathematical Markup Language
More Related Links
PurePerl MySQL API
Major in Website Design
Perl Course - Optimized
Web Development Course
BACK NEXT