Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


HELP!! Date format query

HELP!! Date format query

HELP!! Date format query

I hope someone can assist:

I am setting up an XML output from our system to a third party vendor and I cannot get date elements to validate against their schema.

The schema sets the date format as:

- <xs:simpleType name="Date">
- <xs:restriction base="xs:string">
<xs:pattern value="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$" />

I must confess I'm no XML expert and I'm finding it hard to work out the expected format from the above.

If anyone can help and enlighten me it would be greatly appreciated.


RE: HELP!! Date format query

Welcome to Tek-Tips!


It is quite a complex regular expression that is dealing with a limited range of leap years and the normal complexities of the other months have 30 or 31 days. "Thirty days hath September..." in the form of a regular expression!

By the way, this is not the representation for a 'normal' XML date which would be xs:date. Too bad, as the XML date type is well defined.

Tom Morrison
Hill Country Software

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close