Joe Celko's SQL for Smarties: Advanced SQL Programming, Third Edition

Chapter 4: Temporal Data Types in SQL

Overview

Clifford simak wrote a science fiction novel entitled Time Is the Simplest Thing in 1977. He was wrong. And the problems did not start with the Y2K problems we had in 2000, either. The calendar is irregular, and the only standard unit of time is the second; years, months, weeks, hours, minutes, and so forth are not part of the metric system, but are mentioned in the ISO standards as conventions.

SQL-92 added temporal data to the language, acknowledging what was already in most SQL products by that time. The problem is that each vendor had made an internal trade-off. In Chapter 29, we will get into SQL code, but since this is an area where people do not have a good understanding, it is better to start with foundations.

4.1 Notes on Calendar Standards

Leap years did not exist in the Roman or Egyptian solar calendars prior to the year 708 A.U.C. ( ab urbe condita, Latin for "from the founding of the City [Rome]").

Unfortunately, the solar year is not an even number of days; there are 365.2422 days in a year, and the fraction adds up over time. The civil and religious solar calendars had drifted with respect to the solar year by approximately one day every four years. For example, the Egyptian calendar drifted completely around approximately every 1,461 years. As a result, it was useless for agriculture, so...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Solar Panels
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.