How to write Custom time to blob metadata GCS object?

Solution 1:

From the best of my understanding, the custom_time is read only. See https://googleapis.dev/python/storage/latest/blobs.html#google.cloud.storage.blob.Blob.custom_time

You might would prefer to work with the metadata property - https://googleapis.dev/python/storage/latest/blobs.html#google.cloud.storage.blob.Blob.metadata - which can be set (as a dictionary, for example) in addition to retrieval.

Additional description is here: https://cloud.google.com/storage/docs/metadata#custom-metadata , and an example is here: https://cloud.google.com/storage/docs/viewing-editing-metadata#storage-set-object-metadata-python