XSD Tutorials - Herong's Tutorial Examples - Version 5.10, by Dr. Herong Yang

Date/Time Seven-Property Model

This section describes the seven-property model used in XSD 1.1 to represent a moment of time in the Gregorian calendar system: year, month, day, hour, minute, second and timezoneOffset.

XSD 1.1 uses a date/time seven-property model to represent a moment of time in the Gregorian calendar system. This model is closely related to "ISO 8601 - Data elements and interchange formats" standard.

In this model, any moment of time is represented with a set of 7 values named as:

  • "year" - An "int" value representing Gregorian calendar year.
  • "month" - An "int" value between 1 and 12 inclusive representing Gregorian calendar month.
  • "day" - An "int" value between 1 and 31 inclusive representing Gregorian calendar day.
  • "hour" - An "int" value between 0 and 23 inclusive representing hour of the time
  • "minute" - An "int" value between 0 and 59 inclusive representing minute of the time
  • "second" - A "decimal" value greater than or equal to 0.0 and less than 60.0 representing seconds and fractions of a second of the time
  • "timezoneOffset" - An "int" value between -840 and 840 inclusive representing timezone offset from UTC in minutes.

Each property in the seven-property model has its own lexical space:

  • "year" lexical space is all "year" values expressed with in -?\d\d\d\d+ pattern. Zero padding is required to have a minimum of 4 decimal digits. Zero padding is not allowed if there are more than 4 decimal digits.
  • "month" lexical space is all "month" values expressed with zero-padding in \d\d pattern.
  • "day" lexical space is all "day" values expressed with zero-padding in \d\d pattern.
  • "hour" lexical space is all "hour" values expressed with zero-padding in \d\d pattern.
  • "minute" lexical space is all "minute" values expressed with zero-padding in \d\d pattern.
  • "second" lexical space is all "second" values expressed with zero-padding in \d\d(\.\d+)? pattern.
  • "timezoneOffset" lexical space is all "timezoneOffset" values expressed with zero-padding in Z|((\+|-)\d\d:\d\d) pattern. "Z" represents UTC timezone and equals to +00:00 or -00:00.

With this date/time seven-property model, the moment at midnight on 2013 new year's eve at New York city can be represented as:

Property         Value   Lexical Presentation

year             2013    2013
month            1       01
day              1       01
hour             0       00
minute           0       00
second           0.0     00
timezoneOffset   -300    -05:00

With this seven-property model, "dateTime" and its related built-in datatypes can be easily described in next tutorials.

Last update: 2013.

Table of Contents

 About This Book

 Introduction to XML Schema

 XML Editor and Schema Processor - XMLPad

 Java API for XML Processing - JAXP

 JAXP - XML Schema (XSD) Validation

 Xerces2 Java Parser - Java API of XML Parsers

 Using Xerces2 Java API

 XML Schema Language - Basics

 Introduction of XSD Built-in Datatypes

 "string" and Its Derived Datatypes

 "decimal" and Its Derived Datatypes

"dateTime" and Its Related Datatypes

Date/Time Seven-Property Model

 "dateTime" Datatype Values and Representations

 "dateTimeStamp" Datatype Values and Representations

 "date" Datatype Values and Representations

 "time" Datatype Values and Representations

 "gYear", "gMonth" and "gDay" Datatypes

 "gYearMonth" and "gMonthDay" Datatypes

 "duration" Datatype Values and Representations

 "yearMonthDuration" Datatype Values and Representations

 "dayTimeDuration" Datatype Values and Representations

 Date, Time and Duration Datatype Summary

 Miscellaneous Built-in Datatypes

 Facets, Constraining Facets and Restriction Datatypes

 "simpleType" - Defining Your Own Simple Datatypes

 Complex Element Declaration

 Identity-Constraints: unique, key and keyref

 Assertion as Custom Validation Rules

 XML Schema Location and Namespace in XML Documents

 Overriding Element Types in XML Documents

 Linking Multiple Schema Documents Together

 Glossary

 References

 PDF Printing Version

Date/Time Seven-Property Model - Updated in 2014, by Dr. Herong Yang