03/08/85 encode_clock_value_ NOTE: encode_clock_value_ is replaced by date_time_$to_clock; encode_clock_value_ is supported for compatibility only. Entry points in encode_clock_value_: (List is generated by the help command) :Entry: encode_clock_value_: 03/08/85 encode_clock_value_ Function: The encode_clock_value_ subroutine takes a given month, day of the month, year, hour of the day, minute, second, microsecond, and time zone and returns a system clock reading. When given a day of the week, it performs an optional check on the clock reading to ensure that it falls on the given day. A system clock reading is encoded as the number of microseconds from January 1, 1901 0000.0, Greenwich Mean Time (GMT) to the given date, time, and time zone. Syntax: declare encode_clock_value_ entry (fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin(71), fixed bin, char(3), fixed bin(71), fixed bin(35)); call encode_clock_value_ (month, dom, year, hour, minute, second, microsecond, dow, zone, clock, code); Arguments: month is the month (January = 1, ..., December = 12). (Input) dom is the day of the month, i.e., 1 to 31. (Input) year is the year, e.g., 1982. (Input) hour is the hour of the day (midnight = 0, ..., 11 PM = 23). (Input) minute is the minute of the hour, i.e., 0 to 59. (Input) second is the second of the minute, i.e., 0 to 59. (Input) microsecond is the number of microseconds that are added to the clock reading encoded from the given month, dom, year, hour, minute, and second. (Input) dow is the day of the week (0 = no day of week checking, 1 = Monday, ..., 7 = Sunday). (Input) zone is a three-character abbreviation of the time zone in which the given day of the month and hour are expressed. (Input or Output) Input is one of the zone abbreviations given in the table of time zones (see the convert_date_to_binary_ subroutine), or is a null character string. A zone abbreviation may be given in uppercase or lowercase. If a null string is given, the current time zone used by the process is assumed. Output is a three-character lowercase abbreviation of the current time zone used by the process if a null character string was given as input. clock is the encoded system clock reading. (Output) code is a system status code. (Output) :Entry: offsets: 03/08/85 encode_clock_value_$offsets NOTE: encode_clock_value_$offsets is replaced by date_time_$offset_to_clock; encode_clock_value_$offsets is supported for compatibility only. Function: This entry point takes a system clock reading, a day of the week, and year, month, day, hour, minute, second, and microsecond, offset values. The offset values may be positive, negative, or zero. It returns a clock reading that has been adjusted to fall on the given day of the week, and which is then offset by the given number of years, months, days, hours, minutes, seconds, and microseconds. Syntax: declare encode_clock_value_$offsets entry (fixed bin(71), fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin(71), fixed bin, char(3), fixed bin(71), fixed bin(35)); call encode_clock_value_$offsets (clock_in, month_off, day_off, year_off, hour_off, minute_off, second_off, microsec_off, dow_offset, zone, clock_out, code); Arguments: clock_in is a system clock reading. (Input) month_off is an offset, in months. (Input) day_off is an offset, in days. (Input) year_off is an offset, in years. (Input) hour_off is an offset, in hours. (Input) minute_off is an offset, in minutes. (Input) second_off is an offset, in seconds. (Input) microsec_off is an offset, in microseconds. (Input) dow_off is a day of the week offset (0 = no day of week offset, 1 = offset to next Monday, ..., 7 = offset to next Sunday). (Input) zone is a three-character abbreviation of the time zone in which the input clock reading is to be interpreted. (Input or Output) The choice of zone may alter which day of the week the input clock reading falls on, and may therefore affect any day of the week adjustment. Input is one of the zone abbreviations given in the table of time zones (see the convert_date_to_binary_ subroutine), or is a null character string. A zone abbreviation may be given in uppercase or lowercase. If a null string is given, the current time zone used by the process is assumed. Output is a three-character lowercase abbreviation of the current time zone used by the process if a null character string was given as input. clock_out is the adjusted clock reading. (Output) code is a system status code. (Output) Notes: The order in which offsets are applied to the input clock reading can affect the adjusted clock reading. The encode_clock_value_$offsets entry point uses the order required by the convert_date_to_binary_ subroutine in all cases. The offsets are applied in the following order: 1. Decode the input clock reading into absolute date and time values specified in terms of the input time zone. The time zone can alter the day of the week the input clock reading falls on, and can therefore change the effect of the day of the week offset. 2. Apply any day of the week offset by adding days to the absolute date values from step 1 until the date falls on the given day of the week. 3. Apply any year offset to the absolute date values from step 2. 4. Apply any month offset to the absolute date values from step 3. If applying the month offset results in an invalid date (e.g., 1/31/77 +3 months yields 4/31/77), then adjust the day of the month to be the last day of the new month, taking leap years into account. 5. Apply the day offset to the absolute date values from step 4. 6. Apply the hour, minute, second, and microsecond offsets to the absolute time values from step 1. 7. Encode the absolute date values from step 5 and absolute time values from step 6 to form the adjusted clock reading. ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved