Version
EiffelTime Tutorial
The library EiffelTime is designed to provide software components for the effective modeling and manipulation of dates and times. EiffelTime is built on three notions of time:
- Absolutes are used to denote specific times. For example, an absolute time would be used to denote a particular event, like the starting time for a meeting, say 3:45 p.m.
- Intervals denote the interval between events. So, an interval could express the fact that the meeting will run from 3:45 p.m. until 6:00 p.m.
- Durations are used to represent the length of an interval. So, a duration can express the fact that the meeting lasts for 2 hours and 15 minutes.
As you read this documentation you will notice other concepts that are used in various classes. Here are some examples:
- There is a concept of origin which allows absolute instances to have an anchor in time. The origin for an absolute time is 00:00:00, the earliest time of day. The origin for dates is January 1, 1600. A similar notion, origin date, is used with certain date durations.
- Durations can be in canonical or non-canonical form. Canonical form means that the values for components of the duration fall into the expected range for each component. So, for example a time duration with a value for minutes that is larger than 59 would be in non-canonical form.
- Date durations can be relative or definite. Definite date durations consist only of a number of days. Relative date durations can have values for a number of years and months. As you will see, comparison and arithmetic are affected by whether date durations are relative or definite.
You will read more about these and other EiffelTime concepts in the detailed pages that follow.