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. |
band | The index of the band to update. Band indexes start at 0. |
time | The timestamp to assign to the specified band. Use the format yyyy-MM-dd HH:mm:ss, for example, 2020-08-30 18:00:00. |
start | The start time to assign to the raster. Use the format yyyy-MM-dd HH:mm:ss. |
end | The end time to assign to the raster. Use the format yyyy-MM-dd HH:mm:ss. |
Examples
The following example sets the timestamp of band 0 to 2020-01-02 and reads it back using ST_DateTime.
select ST_DateTime(ST_setDateTime(raster_obj, 0, '2020-01-02'::timestamp), 0)
FROM raster_tableOutput:
st_datetime
--------------------------
Thu Jan 02 00:00:00 2020