Skip to content

Instantly share code, notes, and snippets.

@d-v-b
Created July 7, 2025 15:02
Show Gist options
  • Select an option

  • Save d-v-b/4b1cc363d95e2bb2b958e7c7e106666a to your computer and use it in GitHub Desktop.

Select an option

Save d-v-b/4b1cc363d95e2bb2b958e7c7e106666a to your computer and use it in GitHub Desktop.
Create a Zarr V3 array with a datetime64 data type
# /// script
# dependencies = [
# "zarr@git+https://github.com/zarr-developers/zarr-python.git@main",
# ]
# ///
import numpy as np
import zarr
arr = zarr.create_array(store={}, dtype='datetime64[s]', shape=(3,), zarr_format=3)
arr[:] = np.datetime64('now', 's')
print(arr[:])
# ['2025-07-07T14:59:01' '2025-07-07T14:59:01' '2025-07-07T14:59:01']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment