获得栅格对象或波段的时间。

语法

text ST_DateTime(raster raster_obj);
timetamp ST_DateTime(raster raster_obj,integer band);

参数

参数名称 描述
raster_obj 需要计算的raster对象。
band 波段序号,取值从0开始。

描述

获得栅格对象或波段的时间。如果指定波段,则返回对应波段的时间信息;未指定波段,则返回包含所有波段时间信息的JSON字符串。

示例

SELECT ST_DateTime(raster_obj)
FROM raster_table;

                                                                                                         st_datetime                                                                                                         
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 {"0":"Mon Dec 31 00:00:00 2018","1":"Mon Dec 31 01:00:00 2018","2":"Mon Dec 31 02:00:00 2018","3":"Mon Dec 31 03:00:00 2018","4":"Mon Dec 31 04:00:00 2018","5":"Mon Dec 31 05:00:00 2018","6":"Mon Dec 31 06:00:00 2018",".
.7":"Mon Dec 31 07:00:00 2018","8":"Mon Dec 31 08:00:00 2018","9":"Mon Dec 31 09:00:00 2018","10":"Mon Dec 31 10:00:00 2018","11":"Mon Dec 31 11:00:00 2018","12":"Mon Dec 31 12:00:00 2018","13":"Mon Dec 31 13:00:00 2018".
.,"14":"Mon Dec 31 14:00:00 2018","15":"Mon Dec 31 15:00:00 2018","16":"Mon Dec 31 16:00:00 2018","17":"Mon Dec 31 17:00:00 2018","18":"Mon Dec 31 18:00:00 2018","19":"Mon Dec 31 19:00:00 2018","20":"Mon Dec 31 20:00:00 .
.2018","21":"Mon Dec 31 21:00:00 2018","22":"Mon Dec 31 22:00:00 2018","23":"Mon Dec 31 23:00:00 2018"}
 
 
SELECT ST_DateTime(raster_obj, 0)
FROM raster_table;

         datetime          
---------------------------
"Mon Dec 31 00:00:00 2018"