<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Timestamptz on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/timestamptz/</link><description>Recent content in Timestamptz on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Mon, 15 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/timestamptz/index.xml" rel="self" type="application/rss+xml"/><item><title>timestamptz and tzdata: Avoid Shifted PostgreSQL Timestamps</title><link>https://www.postgresscripts.com/post/timestamptz-and-tzdata-updates-avoiding-shifted-postgresql-timestamps/</link><pubDate>Mon, 15 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/timestamptz-and-tzdata-updates-avoiding-shifted-postgresql-timestamps/</guid><description>
&lt;h2 id="timestamptz-and-tzdata-avoid-shifted-postgresql-timestamps"&gt;timestamptz and tzdata: Avoid Shifted PostgreSQL Timestamps&lt;/h2&gt;
&lt;p&gt;PostgreSQL stores every &lt;code&gt;timestamptz&lt;/code&gt; value as UTC and converts it to the session's time zone only at display time. That design is correct and elegant — until a &lt;code&gt;tzdata&lt;/code&gt; update changes the offset rules for a region, at which point timestamps inserted under the old rules can render at a different local time than the day they were recorded.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="7945792173"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;timestamp with time zone&lt;/code&gt;, almost always written &lt;code&gt;timestamptz&lt;/code&gt;, is the type most applications should use for points in time. The name is slightly misleading: the column does not store a time zone. It stores a single absolute instant as UTC. When you insert a value with an explicit offset, PostgreSQL converts it to UTC for storage and discards the original zone; when you read it back, it converts from UTC to whatever the session's &lt;code&gt;TimeZone&lt;/code&gt; parameter is set to. Two clients in different zones see the same instant rendered in their own local time, and that is exactly the behavior you want.&lt;/p&gt;</description></item></channel></rss>