Skip to content
ptrb edited this page May 29, 2013 · 3 revisions

Name and Parameters

tm_distance( PostTIME , PostTIME ) : text

Description

This function calculates the distance between two primitive objects and returns the result as ISO8601-duration-string. If the instances are using a temporal coordinate system the gregrioan calendar's rules will be used for calculation.

Examples

SELECT tm_distance('2013-5-8T16:14:12.345','2013-5-9T22:21:20.191');
-- result
'P1DT6H7M7.846S'

SELECT tm_distance('TCS0021368029652.345000','TCS0021368138080.191000');
-- result
'P1DT6H7M7.846S'

SELECT tm_distance('2010/2016-2-29T12','2038-1-19T03:14:08');
-- result
'P21Y10M18DT15H14M8.000S'

Processable Objects

| CAL | TCS | ORD ---|---|---|--- TM_Instant | ✔ | ✔ | ✗ TM_Period | ✔ | ✔ | ✗ MultiInstant | ∼ | ∼ | ✗ MultiPeriod | ∼ | ∼ | ✗ RegularMultiInstant | ∼ | ∼ | ✗ RegularMultiPerid | ∼ | ∼ | ✗ ✔ : Processable

✗ : Call will cause an error

∼ : Callable without error, but returns only a pseudo result

Related functions

tm_distance_dec_day


List of SQL Functions