Currently, HDF5 does not provide a time type (H5T_TIME is no longer supported), so there is no obvious mapping for datetime64.
One of the design goals for h5py was to enter the HDF5 core set of features. This allows people to write data to their files and know that they will go both ways and can be restored by people using other applications that support HDF5, such as IDL and Matlab. Earlier we made some minor exceptions; for example, NumPy bools and complex numbers are mapped to HDF5 enumerations and composite types, respectively. But datetime64 seems to be a much more complex animal.
If there is no convincing suggestion that ensures that (1) crawl information and (2) other HDF5 clients can reasonably understand, I think we are not going to implement native datetime64 support.
In HDF5, people usually store their dates / times as string values ββusing some variation of the ISO date format. You can think of it as a workaround.
See also: https://github.com/h5py/h5py/issues/443
Andrew Collette
source share