-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraft-thierry-bulk-time-00.xml
356 lines (323 loc) · 11.4 KB
/
draft-thierry-bulk-time-00.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="lib/rfc2629.xslt"?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no" ?>
<?rfc linkmailto="no" ?>
<?rfc editing="no" ?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc-ext allow-markup-in-artwork="yes" ?>
<?rfc-ext include-index="no" ?>
<rfc ipr="trust200902"
category="exp"
docName="draft-thierry-bulk-time-00"
xmlns:x="http://purl.org/net/xml2rfc/ext">
<x:feedback template="mailto:[email protected]"/>
<front>
<title abbrev="BULK-Time">BULK Time namespace</title>
<author initials="P." surname="Thierry" fullname="Pierre Thierry">
<organization>Thierry Technologies</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<date day="7" month="August" year="2013" />
<keyword>binary</keyword>
<abstract>
<t>
This specification describes a BULK serialization of time informations.
</t>
</abstract>
</front>
<middle>
<section anchor="intro" title="Introduction">
<section title="Conventions and Terminology">
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD
NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as
described in <xref target="RFC2119">RFC 2119</xref>.
</t>
<t>
Literal numerical values are provided in decimal or hexadecimal as appropriate.
Hexadecimal literals are prefixed with <spanx style="verb">0x</spanx> to distinguish them
from decimal literals.
</t>
<t>
BULK bytes sequences and expressions are described with the same conventions than used in
the <xref target="BULK1">BULK 1.0 specification</xref>
</t>
</section>
</section>
<section title="BULK Time namespace">
<t>
The time namespace is an official namespace identified by the UUID <eref
target="urn:uuid:a0236aea-9923-511d-b755-66be75151201"/> (BULK, "Time passed, which,
basically, is its job."). It provides a standard way to serialize some formats used to
express time, mainly those from <xref target="ISO8601">ISO 8601</xref>.
</t>
<section title="Types">
<t>This specification defines the following types:</t>
<t>
<list style="hanging">
<t hangText="Int123">a sequence of type <spanx style="verb">Int</spanx>, <spanx
style="verb">Int Int</spanx> or <spanx style="verb">Int Int Int</spanx></t>
<t hangText="IntsF">a sequnce of one or more expressions, all of which MUST be of type
<spanx style="verb">Int</spanx>, except the last which can also be of type <spanx
style="verb">Float</spanx></t>
</list>
</t>
</section>
<section title="ISO 8601">
<t>
Note that BULK serializations of single points in time are notably bigger than a string
containing their ISO 8601 notation. Such times SHOULD be serialized as offsets against an
epoch (like Julian date or Unix time), except where simplicity of implementation is
wanted.
</t>
<section title="Calendar date">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x1</spanx> (mnemonic: <spanx
style="verb">calendar</spanx> )</t>
<t hangText="shape"><spanx style="verb">( calendar Int123 )</spanx></t>
</list>
</t>
<t>
This serializes dates like 1999, 2001-06 or 2013-08-06.
</t>
<t>Types: <spanx style="verb">Time</spanx>, <spanx style="verb">Date</spanx></t>
</section>
<section title="Week date">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x2</spanx> (mnemonic: <spanx
style="verb">weekdate</spanx> )</t>
<t hangText="shape"><spanx style="verb">( weekdate Int123 )</spanx></t>
</list>
</t>
<t>
This serializes dates like 1979, 1987-W06 or 2012-W52-1.
</t>
<t>Types: <spanx style="verb">Time</spanx>, <spanx style="verb">Date</spanx></t>
</section>
<section title="Ordinale date">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x3</spanx> (mnemonic: <spanx
style="verb">ordinal</spanx> )</t>
<t hangText="shape"><spanx style="verb">( ordinal Int Int )</spanx></t>
</list>
</t>
<t>
This serializes dates like 2004-006 or 2000-366.
</t>
<t>Types: <spanx style="verb">Time</spanx>, <spanx style="verb">Date</spanx></t>
</section>
<section title="Time of day">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x4</spanx> (mnemonic: <spanx
style="verb">time-of-day</spanx> )</t>
<t hangText="shape"><spanx style="verb">( time-of-day {components}:IntsF )</spanx></t>
</list>
</t>
<t>
This serializes times like 22, 13:45 or 06:34:57.3. {components} MUST contain from 1 to
3 expressions.
</t>
<t>Types: <spanx style="verb">Time</spanx>, <spanx style="verb">TimeOfDay</spanx></t>
</section>
<section title="Point in time">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x5</spanx> (mnemonic: <spanx
style="verb">point</spanx> )</t>
<t hangText="shape"><spanx style="verb">( point Date TimeOfDay )</spanx></t>
</list>
</t>
<t>
This serializes dates like 2005-W34-7T19:45.
</t>
<t>Type: <spanx style="verb">Time</spanx></t>
</section>
<section title="UTC time">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x6</spanx> (mnemonic: <spanx
style="verb">zulu</spanx> )</t>
<t hangText="shape"><spanx style="verb">( zulu Time )</spanx></t>
</list>
</t>
<t>
This serializes times like 2005-W34-7T19:45Z or 11:53:23Z.
</t>
<t>Type: <spanx style="verb">Time</spanx></t>
</section>
<section title="Offset time">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x7</spanx> (mnemonic: <spanx
style="verb">offset</spanx> )</t>
<t hangText="shape"><spanx style="verb">( offset TimeOfDay Time )</spanx></t>
</list>
</t>
<t>
This serializes times like 2005-W34-7T19:45+02 or 11:53-01:30.
</t>
<t>Type: <spanx style="verb">Time</spanx></t>
</section>
<section title="Durations">
<t>
<list style="hanging">
<t hangText="0x8"><spanx style="verb">years</spanx></t>
<t hangText="0x9"><spanx style="verb">months</spanx></t>
<t hangText="0xA"><spanx style="verb">days</spanx></t>
<t hangText="0xB"><spanx style="verb">hours</spanx></t>
<t hangText="0xC"><spanx style="verb">minutes</spanx></t>
<t hangText="0xD"><spanx style="verb">seconds</spanx></t>
<t hangText="0xE"><spanx style="verb">weeks</spanx></t>
</list>
</t>
<t>
All durations have the same shape: <spanx style="verb">( Ref {components}:IntsF
)</spanx>. { components} must contain from 1 to respectively 6, 5, 4, 3, 2, 1 and 1
expressions.
</t>
<t>Type: <spanx style="verb">Duration</spanx></t>
</section>
<section title="Interval">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0xF</spanx> (mnemonic: <spanx
style="verb">interval</spanx> )</t>
<t hangText="shape"><spanx style="verb">( interval Time Time )</spanx></t>
<t hangText="shape"><spanx style="verb">( interval Time Duration )</spanx></t>
<t hangText="shape"><spanx style="verb">( interval Duration Time )</spanx></t>
<t hangText="shape"><spanx style="verb">( interval Duration )</spanx></t>
</list>
</t>
<t>Type: <spanx style="verb">Interval</spanx></t>
</section>
<section title="Repeating intervals">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x10</spanx> (mnemonic: <spanx
style="verb">repeat</spanx> )</t>
<t hangText="shape"><spanx style="verb">( interval Int Interval )</spanx></t>
<t hangText="shape"><spanx style="verb">( interval Interval )</spanx></t>
</list>
</t>
</section>
</section>
<section title="Julian date">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x11</spanx> (mnemonic: <spanx
style="verb">julian</spanx> )</t>
<t hangText="shape"><spanx style="verb">( julian {num}:Number )</spanx></t>
</list>
</t>
<t>
It serializes the Julian Day Number (if {num} has type Int) or the Julian Date (if {num}
has type Float).
</t>
</section>
<section title="Unix time">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x12</spanx> (mnemonic: <spanx
style="verb">unix-time</spanx> )</t>
<t hangText="shape"><spanx style="verb">( unix-time Number )</spanx></t>
</list>
</t>
<t>
It serializes the number of seconds since or until the Unix epoch (with microsecond or
nanosecond precision if the number has type Float).
</t>
</section>
<section title="Star Trek TNG stardate">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x13</spanx> (mnemonic: <spanx
style="verb">tng-stardate</spanx> )</t>
<t hangText="shape"><spanx style="verb">( tng-stardate Int Int )</spanx></t>
</list>
</t>
<t>
It serializes a stardate following the conventions of Star Trek: The Next Generation and
following series.
</t>
</section>
<section title="Anno Mundi">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x14</spanx> (mnemonic: <spanx
style="verb">anno-mundi</spanx> )</t>
<t hangText="shape"><spanx style="verb">( anno-mundi Int123 )</spanx></t>
</list>
</t>
<t>
It serializes a date in the hebrew calendar.
</t>
</section>
<section title="Anno Hegirae">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x15</spanx> (mnemonic: <spanx
style="verb">anno-hegirae</spanx> )</t>
<t hangText="shape"><spanx style="verb">( anno-hegirae Int123 )</spanx></t>
</list>
</t>
<t>
It serializes a date in the islamic calendar.
</t>
</section>
</section>
<section title="Security Considerations" anchor="sec">
</section>
</middle>
<back>
<references title="Normative References">
<reference anchor="RFC2119">
<front>
<title>
Key words for use in RFCs to Indicate Requirement Levels
</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
<address><email>[email protected]</email></address>
</author>
<date month="March" year="1997"/>
</front>
<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
</reference>
<reference anchor="BULK1">
<front>
<title>Binary Uniform Language Kit 1.0</title>
<date day="7" month="August" year="2013"/>
<author initials="P." surname="Thierry" fullname="Pierre Thierry">
<organization>Thierry Technologies</organization>
<address>
<email>[email protected]</email>
</address>
</author>
</front>
<seriesInfo name="Internet-Draft" value="draft-thierry-bulk-02"/>
</reference>
</references>
<references title="Informative references">
<reference anchor="ISO8601">
<front>
<title>ISO 8601:2004 Data elements and interchange formats -- Information interchange -- Representation
of dates and times</title>
<date year="2004"/>
</front>
</reference>
</references>
</back>
</rfc>