Then which one of the hundred would be appropriate?
comp.text.xml
What is the proper way to include the date stamp?
XML is just a transport protocol, not an application. Although it's
widely thought that "anything written in XML can be read by anything
that understands XML", this is a misleading falsehood. XML is just
the starting point, you also need both parties to agree on a shared
vocabulary, which in XML terms would be the "schema".
If the schema has a property that needs date/time as a value domain,
then the schema will indicate how to encode this. If you don't follow
that, then things will break.
If you haven't yet selected a schema, then choose one. It's better to
adopt an existing and widely-used schema than it is to create a new
one. Even if you create the most perfect schema ever, the advantge
(for internet work) is in _communication_ between pre-existing and pre-
understood tools, not in creating new ones specific to your own
project. If you're looking at page metadata, then reading about
"Dublin Core" would be a very good start. If you want to embed
metadata into web pages, then RDFa or even Microformats might be
useful to learn about.
Now, how to represent date/time in XML. There are two ways, one is to
break down the components as separate XML nodes (i.e. element content
or attribute values), but this is needlessly verbose and very rarely
done these days. The other, far more widely used, is to represent
"date/time" as a single string and place that anywhere into yoru XML,
as either an element's content or an attribute's value. The "XML
format" problem now turns back into the old "date/time string format"
problem.
There are two popular solutions to this: RFC822 and ISO8601, which are
easily worked with and converted between, but are different. Both are
"widely used" (they're not going away anytime soon), but I'd suggest
ISO8601.
RFC822 is the older pre-web Internet format for date/time and it's
still used in email messages accordign to RFC822
ISO8601 is a newer "web era" format and is favoured by the W3C, thus
more widely used for web content.
Both of these follow the "generate precisely, consume flexibly"
approach. They're non-trivial formats and there are lots of aspects
you can use, but don't always have to. However anything that parses
them ought to understand the full format and deal with all the
complexities (any sensible langauge will already have parsing
routines, you don't need to write these).
Please indicate the timezone on all of your generated date/time
timestamps. It's a big world out there.
Learn the distinction between 00:00 UTC midnight and something that's
purely a date stamp, or that indicates "local midnight", regardless of
timezone. This makes integration of worldwide systems a lot easier, if
you're clear about it up-front.