|
|
|
|
|
|
|
is the practice of recording time in terms of decimal hours. This is a kind of strange hybrid, historically, in which the hour is retained, but an attempt is made to decimalize this unit, instead of using the usual hourminutesecond format. This format is used for certain scientific and technical purposes where the use of the hour as a unit is important in calculations, which are simplified by the decimal format. |
|
|
|
|
|
|
|
|
The second variant, the use of the 12-hour clock instead of the 24-hour clock, is by far the more common. In this format, each hour number is repeated, and the two must be then distinguished by an additional nonnumeric indicator, which is normally a. m. (ante meridiem, before noon) and p.m. (post meridiem, after noon). Although the general trend is away from this confusing and out-dated usage, the bulk of the population in many countries continues to use it. |
|
|
|
|
|
|
|
|
5.6.6.1
Decimal Hour Time |
|
|
|
|
|
|
|
|
Two functions accommodate decimal hour time. These functions convert decimal hour time to and from the standard SCDTL 24-hour clock time in HMS (hourminutesecond) format. Thus, applications may use decimal hours, and these units may be converted into a form compatible with the remainder of the SCDTL system. Decimal hours are treated as type double variables. |
|
|
|
|
|
|
|
|
hours_decimal_to_time () converts time expressed as decimal hours to the same time, expressed as a TIME_INFO structure, in an HMS format. |
|
|
|
|
|
|
|
|
time_to_hours_decimal () converts a time of day expressed as a TIME_INFO structure formatted in HMS to the equivalent value formatted as decimal hours. |
|
|
|
|
|
|
|
|
5.6.6.2
Twelve-Hour Clock Time |
|
|
|
|
|
|
|
|
Two functions accommodate 12-hour clock time (Listings 5.12 and 5.13, pages 101, 102). These functions convert 12-hour clock time to and from the standard SCDTL 24-hour clock time. For this purpose, a special data structure has been implemented in the SCDTL system, the TIME_12 structure, defined in the header file time_12.h. This header is included in the header file scdtl_1.h, which is in turn included in the header file scdtl_2.h. |
|
|
|
|
|
|
|
|
Given the widespread use of the 12-hour clock, you may wonder that more functions are not provided for its use. The SCDTL approach is to use the 24-hour clock because it is a more rational system, consistent with the actual division of the day into 24 hours. The identification of time in the 24-hour clock system is strictly numeric and requires no additional qualifiers. The general trend toward the use of the 24-hour clock is based upon a recognition of its superiority. The continued use of the 12-hour clock is based less upon any consideration of its relative strengths, than upon a general social inertia to resist change. |
|
|
|
|
|