@@ -117,17 +117,20 @@ consists of 3 parts:
117
117
``">" ``: big-endian; ``"|" ``: not-relevant)
118
118
* One character code giving the basic type of the array (``"b" ``: Boolean (integer
119
119
type where all values are only True or False); ``"i" ``: integer; ``"u" ``: unsigned
120
- integer; ``"f" ``: floating point; ``"c" ``: complex floating point; ``"S" ``: string
121
- (fixed-length sequence of char); ``"U" ``: unicode (fixed-length sequence of
122
- Py_UNICODE); ``"V" ``: other (void * – each item is a fixed-size chunk of memory))
120
+ integer; ``"f" ``: floating point; ``"c" ``: complex floating point; ``"m" ``: timedelta;
121
+ ``"M" ``: datetime; ``"S" ``: string (fixed-length sequence of char); ``"U" ``: unicode
122
+ (fixed-length sequence of Py_UNICODE); ``"V" ``: other (void * – each item is a
123
+ fixed-size chunk of memory))
123
124
* An integer specifying the number of bytes the type uses.
124
125
125
126
The byte order MUST be specified. E.g., ``"<f8" ``, ``">i4" ``, ``"|b1" `` and
126
127
``"|S12" `` are valid data type encodings.
127
128
128
- Please note that NumPy's datetime64 ("M") and timedelta64 ("m") data types are **not **
129
- currently supported. Please store data using an appropriate physical data type instead,
130
- e.g., 64-bit integer.
129
+ For datetime64 ("M") and timedelta64 ("m") data types, these MUST also include the
130
+ units within square brackets. A list of valid units and their definitions are given in
131
+ the `NumPy documentation on Datetimes and Timedeltas
132
+ <https://docs.scipy.org/doc/numpy/reference/arrays.datetime.html#datetime-units> `_.
133
+ For example, ``"<M8[ns]" `` specifies a datetime64 data type with nanosecond time units.
131
134
132
135
Structured data types (i.e., with multiple named fields) are encoded as a list
133
136
of two-element lists, following `NumPy array protocol type descriptions (descr)
@@ -476,8 +479,8 @@ initially published to clarify ambiguities and add some missing information.
476
479
decoded for arrays with a fixed-length byte string data type (:issue: `165 `,
477
480
:issue: `176 `).
478
481
479
- * The specification now clarifies that datetime64 and timedelta64 data types are not
480
- supported in this version (:issue: `85 `).
482
+ * The specification now clarifies that units must be specified for datetime64 and
483
+ timedelta64 data types (:issue: `85 `, :issue: ` 215 `).
481
484
482
485
* The specification now clarifies that the '.zattrs' key does not have to be present for
483
486
either arrays or groups, and if absent then custom attributes should be treated as
0 commit comments