ST_SetDateTime

更新时间: 2026-12-02 12:20:35

Sets the start and end time of a raster, or the time information of a 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 whose start and end time you want to set.
band The sequence number of the band whose time information you want to set. Valid values start from 0.
time The time information of the specified band. Use the yyyy-MM-dd HH:mm:ss format. Example: 2020-08-30 18:00:00.
start The start time to set. Use the yyyy-MM-dd HH:mm:ss format.
end The end time to set. Use the yyyy-MM-dd HH:mm:ss format.

Description

ST_SetDateTime sets the start and end time of a raster object, or the time information of a specific band. The function returns a raster object.

Examples

select ST_DateTime(ST_setDateTime(raster_obj, 0, '2020-01-02'::timestamp), 0)
FROM raster_table

Output:

       st_datetime
--------------------------
 Thu Jan 02 00:00:00 2020
上一篇: ST_DateTime 下一篇: Operators