xsd:date and xsd:pattern together for custom data type.. ">
Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

Schema Tutorial
XML Schema Introduction
Why Use XML Schemas?
XSD How To?
XSD - The <schema> Element
XSD Simple Elements
XSD Attributes
XSD Restrictions/Facets
XSD Complex Elements
XSD Complex Empty Elements
XSD Complex Type - Elements Only
XSD Complex Text-Only Elements
XSD Complex Types With Mixed Content
XSD Complex Types Indicators
XSD The <any> Element
XSD The <anyAttribute> Element
XSD Element Substitution
An XSD Example
XSD String Data Types
XSD Date Data Types
XSD Numeric Data Types
XSD Miscellaneous Data Types
You Have Learned XML Schema, Now What?

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


XSD Date Data Types
Previous Next


Date and time data types are used for values that contains date and time.



Date Data Type

The date data type is used to specify the particular date.

The date is specified in the following form "YYYY-MM-DD" where:

  • YYYY indicat the year
  • MM indicate the month
  • DD indicate the day

Note: All the components are required!

The following is an example of a date declaration in a schemas:

<xs:element name="start" type="xs:date"/>

An element in your document might look as follows:

<start>2002-09-24</start>



Time Zones

To specify a time zone, you can either enter a date in UTC time by adding a "Z" behind the date - as follows:

<start>2002-09-24Z</start>

or you can specify an offset from the UTC time by adding a positive or negative time behind the date - as follows:

<start>2002-09-24-06:00</start>
or
<start>2002-09-24+06:00</start>


Time Data Type

The time data type is used to specify the particular time.

The time is specified in the form like "hh:mm:ss" where:

  • hh indicate the hour
  • mm indicate the minute
  • ss indicate the second

Note: All the components are required!

The following is an example of a time declaration in the schema:

<xs:element name="start" type="xs:time"/>

An element in your document might look as follows:

<start>09:00:00</start>

Or it might look as follows:

<start>09:30:10.5</start>


DateTime Data Type

The dateTime data type is used to specify the date and a time.

The dateTime can be specified in the following form "YYYY-MM-DDThh:mm:ss" where:

  • YYYY indicate the year
  • MM indicate the month
  • DD indicate the day
  • T indicate the start of the required time section
  • hh indicate the hour
  • mm indicate the minute
  • ss indicate the second

Note: All the components are required!

The following is an example of a dateTime declaration in the schema:

<xs:element name="startdate" type="xs:dateTime"/>

An element in your document might look as follows:

<startdate>2002-05-30T09:00:00</startdate>

Or it might look as follows:

<startdate>2002-05-30T09:30:10.5</startdate>


Duration Data Type

The duration data type is used to specify the time interval.

The time interval can be specified in the following form "PnYnMnDTnHnMnS" where:

  • P indicate the period (required)
  • nY indicate the number of years
  • nM indicate the number of months
  • nD indicates the number of days
  • T indicate the start of a time section (required if you are going to specify hours, minutes, or seconds)
  • nH indicate the number of hours
  • nM indicate the number of minutes
  • nS indicate the number of seconds

The following is an example of a duration declaration in the schema:

<xs:element name="period" type="xs:duration"/>

An the elements in your document might look as follows:

<period>P5Y</period>

The example above indicate a period of five years.

Or it might look as follows:

<period>P5Y2M10D</period>

The example above indicate a period of five years, two months, and 10 days.

Or it might look as follows:

<period>P5Y2M10DT15H</period>

The example above indicate a period of five years, two months, 10 days, and 15 hours.

Or it might look as follows:

<period>PT15H</period>

The example above indicate a period of 15 hours.



Negative Duration

To specify a negative duration, enter a minus sign before P:

<period>-P10D</period>
The example above indicate a period of minus 10 days.


Date and Time Data Types
Name Description
date Defines a date value
dateTime Defines a date and time value
duration Defines a time interval
gDay Defines a part of a date - the day (DD)
gMonth Defines a part of a date - the month (MM)
gMonthDay Defines a part of a date - the month and day (MM-DD)
gYear Defines a part of a date - the year (YYYY)
gYearMonth Defines a part of a date - the year and month (YYYY-MM)
time Defines a time value


Restrictions on Date Data Types

Restrictions that can be used with the Date data types:

  • enumeration
  • maxInclusive
  • maxExclusive
  • minExclusive
  • minInclusive
  • pattern
  • whiteSpace



Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords: XSD date datatype,sql server datatype,sql server date,xsd date format,sql date datatype,xsd tutorial,sql xsd,xsd format,oracle xsd,xsd xml,xsd examples,xsd dtd,sample xsd,xsd validator,xsd specification,xsd syntax,xsd example,xsd tools


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.