date
Learning Focus
Use this lesson to choose date for date-only values and avoid time zone confusion.
date Overview
- Stores a calendar date (no time)
- Best for: birthdays, due dates, invoice dates
Example
CREATE TABLE invoices (
invoice_id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
due_date date NOT NULL
);