In applications like nancial trading, scheduling, manufacturing and process control, time based predicates in queries and rules are very important. There is also a need to dene sets of time points or intervals. We refer to these sets as calendars. This paper presents a system of calendars that allows specication of natural-language time-based expressions, maintenance of valid time in databases, specication of temporal conditions in database queries and rules, and user-dened semantics for date manipulation. A simple set based language is proposed to dene, manipulate and query calendars. The design of the parser and an algorithm for ecient evaluationofcalendar expressions is also described. The paper also describes the implementation of time-based rules in POSTGRES using the proposed system of calendars.