Sets the start and end time of a raster object, or the timestamp of a specific band.
Syntax
raster ST_setDateTime(raster raster_obj,
timestamp start,
timestamp end);
raster ST_setDateTime(raster raster_obj,
integer band,
timestamp time);Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object to update. |
start | The start time to set on the raster. Use the format yyyy-MM-dd HH:mm:ss. |
end | The end time to set on the raster. Use the format yyyy-MM-dd HH:mm:ss. |
band | The band number to update. Band numbering starts at 0. |
time | The timestamp to set on the specified band. Use the format yyyy-MM-dd HH:mm:ss. Example: 2020-08-30 18:00:00. |
Examples
Set the timestamp for a single band and verify the result
SELECT ST_DateTime(ST_setDateTime(raster_obj, 0, '2020-01-02'::timestamp), 0)
FROM raster_table;
st_datetime
--------------------------
Thu Jan 02 00:00:00 2020What's next
ST_DateTime — retrieve the timestamp of a raster or a specific band