Add a timezone-specific variant of date_trunc().
Tom Lane <tgl@sss.pgh.pa.us>
Add a timezone-specific variant of date_trunc(). date_trunc(field, timestamptz, zone_name) performs truncation using the named time zone as reference, rather than working in the session time zone as is the default behavior. It's equivalent to date_trunc(field, timestamptz at time zone zone_name) at time zone zone_name but it's faster, easier to type, and arguably easier to understand. Vik Fearing and Tom Lane Discussion: https://postgr.es/m/6249ffc4-2b22-4c1b-4e7d-7af84fedd7c6@2ndquadrant.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +45 −8 |
| src/backend/utils/adt/timestamp.c | modified | +86 −11 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +12 −7 |
| src/test/regress/expected/timestamptz.out | modified | +18 −0 |
| src/test/regress/sql/timestamptz.sql | modified | +4 −0 |
Documentation touched
Discussion
- date_trunc() in a specific time zone 20 messages · 2018-10-29 → 2018-11-14