ポイントオブジェクトのタイムゾーン情報を取得します。
構文
cstring ST_TimeZone(geometry point, boolean timezoneId, integer timezonePrecision);
cstring ST_TimeZone(geography point, boolean timezoneId, integer timezonePrecision);
パラメーター
パラメーター | 説明 |
point | ジオメトリオブジェクト。The geometry object. 次の要件を満たす必要があります。
|
timezoneId | タイムゾーンを名前形式で返すかどうかを指定します。 有効な値:
|
timezonePrecision | タイムゾーンのデータ精度。 このパラメーターは、timezoneIdパラメーターがtrueに設定されている場合に有効です。 有効な値:
|
戻り値
タイムゾーン文字列が返されます。
説明
ポイントオブジェクトのタイムゾーン情報を取得します。 タイムゾーンの地理的境界データは、Timezone boundary Builderプロジェクトから取得します。
例
SELECT ST_TimeZone('SRID=4326;POINT(121 37)'::geometry);
----
Asia/Shanghai
SELECT ST_TimeZone('POINT(60 37)'::geography);
----
Asia/Tehran
-- A simple time zone string is returned.
SELECT ST_TimeZone('SRID=4326;POINT(121 37)'::geometry, false);
----
Etc/GMT+8
-- The data precision is required.
SELECT ST_TimeZone('SRID=4326;POINT(-121 37)'::geometry, true, 21);
----
America/Los_Angeles
-- The longitude must be greater than 180°.
SELECT ST_TimeZone(('SRID=4326;POINT(400 37)'::geometry));
----
Europe/Istanbul