# PostgreSQL and the calendar

DevFeed: [PostgreSQL and the calendar](<https://devfeed.tech/articles/postgresql-and-the-calendar-34559.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2017/06/postgresql-and-the-calendar/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2017-06-30T12:35:59Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [DateTime](<https://devfeed.tech/topics/datetime.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [function](<https://devfeed.tech/topics/function.md>)

Tags: [data-type](<https://devfeed.tech/tags/data-type.md>), [function](<https://devfeed.tech/tags/function.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

This tutorial explains how PostgreSQL handles calendar-related computations, including ISO week numbering, leap years, date series, and interval values. It recommends using PostgreSQL's built-in date/time functions and data types instead of implementing these calculations manually.

## Source excerpt

The modern calendar is a trap for the young engineer's mind. We deal with the calendar on a daily basis and until exposed to its insanity it's rather common to think that calendar based computations are easy. That's until you've tried to do it once. A very good read about how the current calendar came to be the way it is now is Erik's Naggum The Long, Painful History of Time.