{"Entry":{"collection":"func","key":"date-subtract","name":"date_subtract","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"15","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"16"}],"content_hash":"a1da15f6a78f2f79493ffc4b8c57d92517631bc683ae6592216f8fa0ba14d66b","derived_content_hash":"b06243bea5d66368f64ae0aa644a442527e01a43871016d30bc0d38da28b5af7","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:ae53c921bb2e866ee946ba4b6b06ee4ed77445ef0356d5b642fdefb14edd65f7","versions":{"16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"16","group":"datetime","group_label":"Date/Time Functions And Operators","groups":["datetime"],"imported_at":"2026-09-14T21:49:48.699224+08:00","last_version":"20","name":"date_subtract","name_key":"date_subtract","position":8008,"present_in":["16","17","18","19","20"],"repair_provenance":{"original_source_revision":"2026-09-14T13:14:25.684213+00:00@99e6866c","receipt_sha256":"b89395cc4e772ede0fc73495fd343b190ab0b579b6bb2c22181fecf7426f2e2b","repair":"wiki-repair-20261023"},"signature":"date_subtract ( timestamp with time zone, interval [, text ] ) → timestamp with time zone","signature_count":1,"slug":"date-subtract","source_rev":"wiki-repair-20261023:ae53c921bb2e866ee946ba4b6b06ee4ed77445ef0356d5b642fdefb14edd65f7","summary":"Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted.","summary_zh":""}},"Definition":{"Collection":"func","Key":"date-subtract","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"date-subtract","SourceRevision":"wiki-repair-20261023:ae53c921bb2e866ee946ba4b6b06ee4ed77445ef0356d5b642fdefb14edd65f7","Facts":{"description":"Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted. The form with two arguments is equivalent to the timestamp with time zone - interval operator.","description_html":"Subtract an \u003ccode class=\"type\"\u003einterval\u003c/code\u003e from a \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e setting if that is omitted. The form with two arguments is equivalent to the \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e operator.","description_zh":"从一个 timestamp with time zone 中减去 interval，并根据第三个参数命名的时区，或在省略该参数时根据当前 TimeZone 设置，计算时刻和夏令时调整。双参数形式等价于 timestamp with time zone - interval 操作符。","description_zh_html":"从一个 \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e 中减去 \u003ccode class=\"type\"\u003einterval\u003c/code\u003e，并根据第三个参数命名的时区，或在省略该参数时根据当前 \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e 设置，计算时刻和夏令时调整。双参数形式等价于 \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e 操作符。","doc":{"anchor":"FUNCTIONS-DATETIME-TABLE","file":"functions-datetime.html","sha256":"8c5053713aeaacfbe4cb00effc61f10d457c98b2a29c724b10b93819a087ea95","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-datetime.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"8c5053713aeaacfbe4cb00effc61f10d457c98b2a29c724b10b93819a087ea95","version":"18.7"},{"file":"functions-datetime.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"c3efdd1c3df6795c73dfea2ecec17ca31ff37da23d758083a581d75445851f0c","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"datetime","group_label":"时间/日期函数和操作符","lang":"en","layout":"table-new","pages":["functions-datetime.html"],"prose_only":false,"signatures":[{"description":"Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted. The form with two arguments is equivalent to the timestamp with time zone - interval operator.","description_html":"Subtract an \u003ccode class=\"type\"\u003einterval\u003c/code\u003e from a \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e setting if that is omitted. The form with two arguments is equivalent to the \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e operator.","description_zh":"从一个 timestamp with time zone 中减去 interval，并根据第三个参数命名的时区，或在省略该参数时根据当前 TimeZone 设置，计算时刻和夏令时调整。双参数形式等价于 timestamp with time zone - interval 操作符。","description_zh_html":"从一个 \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e 中减去 \u003ccode class=\"type\"\u003einterval\u003c/code\u003e，并根据第三个参数命名的时区，或在省略该参数时根据当前 \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e 设置，计算时刻和夏令时调整。双参数形式等价于 \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e 操作符。","examples":[{"expr":"date_subtract('2021-11-01 00:00:00+01'::timestamptz, '1 day'::interval, 'Europe/Warsaw')","result":"2021-10-30 22:00:00+00"}],"html":"\u003ccode class=\"function\"\u003edate_subtract\u003c/code\u003e ( \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e, \u003ccode class=\"type\"\u003einterval\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003ccode class=\"type\"\u003etext\u003c/code\u003e\u003c/span\u003e] ) → \u003ccode class=\"returnvalue\"\u003etimestamp with time zone\u003c/code\u003e","returns":"timestamp with time zone","text":"date_subtract ( timestamp with time zone, interval [, text] ) → timestamp with time zone","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-datetime.html","sha256":"2340eed8f18e5a5a727bb6bf8f828eedbab527da91082a214ea4f64a3b8750a6"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-DATETIME-TABLE","file":"functions-datetime.html","sha256":"8c5053713aeaacfbe4cb00effc61f10d457c98b2a29c724b10b93819a087ea95","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"date-subtract","SourceDatabase":"center","Version":"18","Locale":"en","Title":"date_subtract","Summary":"Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted. The form with two arguments is equivalent to the timestamp with time zone - interval operator.","BodyHTML":"Subtract an \u003ccode\u003einterval\u003c/code\u003e from a \u003ccode\u003etimestamp with time zone\u003c/code\u003e, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\" rel=\"nofollow\"\u003eTimeZone\u003c/a\u003e setting if that is omitted. The form with two arguments is equivalent to the \u003ccode\u003etimestamp with time zone\u003c/code\u003e \u003ccode\u003e-\u003c/code\u003e \u003ccode\u003einterval\u003c/code\u003e operator.","SourceRevision":"wiki-repair-20261023:ae53c921bb2e866ee946ba4b6b06ee4ed77445ef0356d5b642fdefb14edd65f7","ContentHash":"6804169760361c12926fc716860fe906e89d97f0441cfe045aac7071cd3e3214","Payload":{"description":"Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted. The form with two arguments is equivalent to the timestamp with time zone - interval operator.","description_html":"Subtract an \u003ccode class=\"type\"\u003einterval\u003c/code\u003e from a \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e setting if that is omitted. The form with two arguments is equivalent to the \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e operator.","signatures":[{"description":"Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted. The form with two arguments is equivalent to the timestamp with time zone - interval operator.","description_html":"Subtract an \u003ccode class=\"type\"\u003einterval\u003c/code\u003e from a \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e setting if that is omitted. The form with two arguments is equivalent to the \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e operator.","description_zh":"从一个 timestamp with time zone 中减去 interval，并根据第三个参数命名的时区，或在省略该参数时根据当前 TimeZone 设置，计算时刻和夏令时调整。双参数形式等价于 timestamp with time zone - interval 操作符。","description_zh_html":"从一个 \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e 中减去 \u003ccode class=\"type\"\u003einterval\u003c/code\u003e，并根据第三个参数命名的时区，或在省略该参数时根据当前 \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e 设置，计算时刻和夏令时调整。双参数形式等价于 \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e 操作符。","examples":[{"expr":"date_subtract('2021-11-01 00:00:00+01'::timestamptz, '1 day'::interval, 'Europe/Warsaw')","result":"2021-10-30 22:00:00+00"}],"html":"\u003ccode class=\"function\"\u003edate_subtract\u003c/code\u003e ( \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e, \u003ccode class=\"type\"\u003einterval\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003ccode class=\"type\"\u003etext\u003c/code\u003e\u003c/span\u003e] ) → \u003ccode class=\"returnvalue\"\u003etimestamp with time zone\u003c/code\u003e","returns":"timestamp with time zone","text":"date_subtract ( timestamp with time zone, interval [, text] ) → timestamp with time zone","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"655a5cbd301422b9ec155759144558c788f3519aff0bc944aabd22dc95970566","Text":"date_subtract ( timestamp with time zone, interval [, text] ) → timestamp with time zone","Returns":"timestamp with time zone","Payload":{"description":"Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted. The form with two arguments is equivalent to the timestamp with time zone - interval operator.","description_html":"Subtract an \u003ccode class=\"type\"\u003einterval\u003c/code\u003e from a \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e setting if that is omitted. The form with two arguments is equivalent to the \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e operator.","description_zh":"从一个 timestamp with time zone 中减去 interval，并根据第三个参数命名的时区，或在省略该参数时根据当前 TimeZone 设置，计算时刻和夏令时调整。双参数形式等价于 timestamp with time zone - interval 操作符。","description_zh_html":"从一个 \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e 中减去 \u003ccode class=\"type\"\u003einterval\u003c/code\u003e，并根据第三个参数命名的时区，或在省略该参数时根据当前 \u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e 设置，计算时刻和夏令时调整。双参数形式等价于 \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e \u003ccode class=\"literal\"\u003e-\u003c/code\u003e \u003ccode class=\"type\"\u003einterval\u003c/code\u003e 操作符。","examples":[{"expr":"date_subtract('2021-11-01 00:00:00+01'::timestamptz, '1 day'::interval, 'Europe/Warsaw')","result":"2021-10-30 22:00:00+00"}],"html":"\u003ccode class=\"function\"\u003edate_subtract\u003c/code\u003e ( \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e, \u003ccode class=\"type\"\u003einterval\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003ccode class=\"type\"\u003etext\u003c/code\u003e\u003c/span\u003e] ) → \u003ccode class=\"returnvalue\"\u003etimestamp with time zone\u003c/code\u003e","returns":"timestamp with time zone","text":"date_subtract ( timestamp with time zone, interval [, text] ) → timestamp with time zone","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
