Great work!

XP to next level

BugEater

DB Persistence (Timestamp vs DateTime)

Advanced All professions 80 XP 75 min

Updated: 07/07/2026

Start Module

Databases are where most date and time bugs are born. Developers choose columns that look right on the surface — DATETIME, TIMESTAMP, DATE — without fully understanding how each type stores, retrieves, and converts values under the hood. A column that works perfectly on a developer's local machine can silently corrupt data the moment the application moves to a server in a different timezone.

This module unpacks the internals of how PostgreSQL and other relational databases represent temporal data. You will learn the differences between TIMESTAMP and TIMESTAMPTZ, why the server timezone setting can retroactively change what every TIMESTAMP column "shows," and why storing dates as plain strings is a trap that always costs more than it saves. You will also explore the sneaky behaviors of auto-update columns like updated_at and the common drift issues caused by clock skew between application servers and database hosts.

By the end of this module, you will be able to design test cases that catch timezone-sensitive DB bugs, verify default values on INSERT, and recognize the telltale signs of implicit type conversion gone wrong.

Module content