All Products
Search
Document Center

ApsaraDB RDS:ST_SetDateTime

Last Updated:Mar 28, 2026

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

ParameterDescription
raster_objThe raster object to update.
startThe start time to set on the raster. Use the format yyyy-MM-dd HH:mm:ss.
endThe end time to set on the raster. Use the format yyyy-MM-dd HH:mm:ss.
bandThe band number to update. Band numbering starts at 0.
timeThe 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 2020

What's next

  • ST_DateTime — retrieve the timestamp of a raster or a specific band