root/trunk/spec/timestamp.dbk

Revision 7, 5.0 KB (checked in by oren, 8 months ago)

April 06, 2008 draft.

Implemented by YamlReference? 0.9.

Contains new productions, new examples, all the changes collected throughout
the last 3 years, and of course JSON compatibility.

Line 
1<?xml version="1.0"?>
2<!DOCTYPE article
3  PUBLIC "-//OASIS//DTD DocBook V4.2//EN"
4         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6<article>
7  <articleinfo>
8    <title>
9      Timestamp Language-Independent Type for
10      <trademark>YAML</trademark>&nbsp;Version&nbsp;1.1
11    </title>
12
13    <subtitle>
14      Working Draft 2005-01-18 - FIXED!!!
15    </subtitle>
16
17    <authorgroup>
18      <author>
19        <firstname>Oren</firstname>
20        <surname>Ben-Kiki</surname>
21        <email>oren@ben-kiki.org</email>
22      </author>
23
24      <author>
25        <firstname>Clark</firstname>
26        <surname>Evans</surname>
27        <email>cce+yaml@clarkevans.com</email>
28      </author>
29
30      <author>
31        <firstname>Brian</firstname>
32        <surname>Ingerson</surname>
33        <email>ingy@ttul.org</email>
34      </author>
35    </authorgroup>
36
37    <copyright>
38      <year>2001-2005</year>
39      <holder>Oren Ben-Kiki<fo>,&nbsp;</fo></holder>
40      <holder>Clark Evans<fo>,&nbsp;</fo></holder>
41      <holder>Brian Ingerson</holder>
42    </copyright>
43
44    <legalnotice>
45      This document may be freely copied provided it is not modified.
46    </legalnotice>
47
48    <abstract>
49      <title>Status</title>
50
51      <para>
52       This specification is a draft reflecting consensus reached by members of
53       the <ulink
54       url="http://lists.sourceforge.net/lists/listinfo/yaml-core">yaml-core
55       mailing list</ulink>. Any questions regarding this draft should be
56       raised on this list.
57      </para>
58    </abstract>
59  </articleinfo>
60
61  <section>
62    <variablelist>
63      <varlistentry>
64        <term>
65          <para>
66            URI:
67          </para>
68        </term>
69
70        <listitem>
71          <para>
72            <userinput>tag:yaml.org,2002:timestamp</userinput>
73          </para>
74        </listitem>
75      </varlistentry>
76
77      <varlistentry>
78        <term>
79          <para>
80            Shorthand:
81          </para>
82        </term>
83
84        <listitem>
85          <para>
86            <userinput>!!timestamp</userinput>
87          </para>
88        </listitem>
89      </varlistentry>
90
91      <varlistentry>
92        <term>
93          <para>
94            Kind:
95          </para>
96        </term>
97
98        <listitem>
99          <para>
100            Scalar.
101          </para>
102        </listitem>
103      </varlistentry>
104
105      <varlistentry>
106        <term>
107          <para>
108            Canonical:
109          </para>
110        </term>
111
112        <listitem>
113<screen>
114[0-9][0-9][0-9][0-9] <lineannotation># (year)</lineannotation>
115-[0-9][0-9] <lineannotation># (month)</lineannotation>
116-[0-9][0-9] <lineannotation># (day)</lineannotation>
117T[0-9][0-9] <lineannotation># (hour)</lineannotation>
118:[0-9][0-9] <lineannotation># (minute)</lineannotation>
119:[0-9][0-9] <lineannotation># (second)</lineannotation>
120(\.[0-9]*[1-9])? <lineannotation># (fraction)</lineannotation>
121Z <lineannotation># (time zone)</lineannotation>
122</screen>
123        </listitem>
124      </varlistentry>
125
126      <varlistentry>
127        <term>
128          <para>
129            Regexp:
130          </para>
131        </term>
132
133        <listitem>
134<screen>
135 [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] <lineannotation># (ymd)</lineannotation>
136|[0-9][0-9][0-9][0-9] <lineannotation># (year)</lineannotation>
137 -[0-9][0-9]? <lineannotation># (month)</lineannotation>
138 -[0-9][0-9]? <lineannotation># (day)</lineannotation>
139 ([Tt]|[ \t]+)[0-9][0-9]? <lineannotation># (hour)</lineannotation>
140 :[0-9][0-9] <lineannotation># (minute)</lineannotation>
141 :[0-9][0-9] <lineannotation># (second)</lineannotation>
142 (\.[0-9]*)? <lineannotation># (fraction)</lineannotation>
143 ([ \t]*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?))? <lineannotation># (time zone)</lineannotation>
144</screen>
145        </listitem>
146      </varlistentry>
147
148      <varlistentry>
149        <term>
150          <para>
151            Definition:
152          </para>
153        </term>
154
155        <listitem>
156          <para>
157            A point in time.
158          </para>
159
160          <para>
161            A timestamp value represents a single point in time. This can be
162            serialized using a subset of the ISO8601 format and the formats
163            proposed by the W3C note on <ulink
164            url="http://www.w3.org/TR/NOTE-datetime">datetime</ulink>. In
165            addition, a more relaxed format is also supported for enhanced
166            readability, using white space separation.
167          </para>
168
169          <para>
170            If the time zone is omitted, the timestamp is assumed to be
171            specified in UTC. The time part may be omitted altogether,
172            resulting in a date format. In such a case, the time part is
173            assumed to be <userinput>00:00:00Z</userinput> (start of day, UTC).
174          </para>
175        </listitem>
176      </varlistentry>
177    </variablelist>
178
179    <example>
180      <title><userinput>!!timestamp</userinput> Examples</title>
181<programlisting>
182canonical:        2001-12-15T02:59:43.1Z
183valid iso8601:    2001-12-14t21:59:43.10-05:00
184space separated:  2001-12-14 21:59:43.10 -5
185no time zone (Z): 2001-12-15 2:59:43.10
186date (00:00:00Z): 2002-12-14
187</programlisting>
188    </example>
189  </section>
190</article>
Note: See TracBrowser for help on using the browser.