{"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","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"],"signature":"date_subtract ( timestamp with time zone, interval [, text ] ) → timestamp with time zone","signature_count":1,"slug":"date-subtract","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","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":"2026-09-14T13:14:25.684213+00:00@99e6866c","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":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-DATETIME-TABLE","file":"functions-datetime.html","slug":"18"},"group":"datetime","group_label":"Date/Time Functions And Operators","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":"","description_zh_html":"","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":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-DATETIME-TABLE","file":"functions-datetime.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"date-subtract","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"date_subtract","Summary":"从一个 timestamp with time zone 中减去 interval，并根据第三个参数命名的时区，或在省略该参数时根据当前TimeZone设置，计算时刻和夏令时调整。双参数形式等价于 timestamp with time zone - interval 操作符。","BodyHTML":"从一个 \u003ccode\u003etimestamp with time zone\u003c/code\u003e 中减去 \u003ccode\u003einterval\u003c/code\u003e，并根据第三个参数命名的时区，或在省略该参数时根据当前\u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\" rel=\"nofollow\"\u003eTimeZone\u003c/a\u003e设置，计算时刻和夏令时调整。双参数形式等价于 \u003ccode\u003etimestamp with time zone\u003c/code\u003e \u003ccode\u003e-\u003c/code\u003e \u003ccode\u003einterval\u003c/code\u003e 操作符。\u003cpre\u003edate_subtract ( timestamp with time zone, interval [, text ] ) → timestamp with time zone\u003c/pre\u003e从一个 \u003ccode\u003etimestamp with time zone\u003c/code\u003e 中减去 \u003ccode\u003einterval\u003c/code\u003e，并根据第三个参数命名的时区，或在省略该参数时根据当前\u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\" rel=\"nofollow\"\u003eTimeZone\u003c/a\u003e设置，计算时刻和夏令时调整。双参数形式等价于 \u003ccode\u003etimestamp with time zone\u003c/code\u003e \u003ccode\u003e-\u003c/code\u003e \u003ccode\u003einterval\u003c/code\u003e 操作符。","SourceRevision":"1b5ca64c","ContentHash":"2427aa90a44a8dd15b6ae0f6e7c6a71e808d1f8566629888fc8ef4edb77cf156","Payload":{"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 操作符。","signatures":[{"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 操作符。","returns":"timestamp with time zone","text":"date_subtract ( timestamp with time zone, interval [, text ] ) → timestamp with time zone","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"500577a851122745469e620e2710603f9c49f265ac6a42f7e1ff5ebf5e622e74","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":"","description_zh_html":"","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":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
