02/06/84 datebin_ The datebin_ subroutine has several entry points to convert clock readings into binary integers (and vice versa) representing the year, month, day, hour, minute, second, current shift, day of the week, number of days since January 1, 1901, and the number of days since January 1 of the year indicated by the clock. Clock readings are Multics Greenwich mean time (GMT); all other arguments represent local time. If arguments passed to datebin_ are not in the valid range, the returned arguments are generally 0 (in certain cases, no checking should be done). Entry points in datebin_: (List is generated by the help command) :Entry: clockathr: 02/06/84 datebin_$clockathr Function: returns a clock reading for the next time the given hour occurs. Syntax: declare datebin_$clockathr entry (fixed bin, fixed bin(71)); call datebin_$clockathr (zz, clock); Arguments: zz is the desired hour and minutes expressed as hhmm in decimal (e.g., 1351). (Input) clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Output) :Entry: datebin: 02/06/84 datebin_ Function: returns the month, day, year, hour, minute, second, weekday, shift, and number of days since January 1, 1901, given a calendar clock reading. Syntax: declare datebin_ entry (fixed bin(71), fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin); call datebin_ (clock, absda, mo, da, yr, hr, min, sec, wkday, s); Arguments: clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Input) absda is the number of the days the clock reading represents (with January 1, 1901 = 1). (Output) mo is the month (1-12). (Output) da is the day of the month (1-31). (Output) yr is the year (1901-1999). (Output) hr is the hour of the day (0-23). (Output) min is the minute of the hour (0-59). (Output) sec is the second of the minute (0-59). (Output) wkday is the day of the week (1 = Monday, 7 = Sunday). (Output) s is the shift, as defined in installation_parms. (Output) :Entry: datofirst: 02/06/84 datebin_$datofirst Function: returns the number of days since January 1, 1901, up to but not including January 1 of the year specified. Syntax: declare datebin_$datofirst entry (fixed bin, fixed bin); call datebin_$datofirst (yr, datofirst); Arguments: yr is the year (1901-1999). (Input) datofirst is the number of days since January 1, 1901, up to, but not including, January 1 of the year specified. (Output) :Entry: dayr_clk: 02/06/84 datebin_$dayr_clk Function: returns the day of the year (1-366) given a calendar clock reading. If clock is invalid, -1 is returned. Syntax: declare datebin_$dayr_clk entry (fixed bin(71), fixed bin); call datebin_$dayr_clk (clock, dayr); Arguments: clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Input) dayr is the day of the year (1-366). (Output) :Entry: dayr_mo: 02/06/84 datebin_$dayr_mo Function: returns the day of the year when given a month, day, and year. Syntax: declare datebin_$dayr_mo entry (fixed bin, fixed bin, fixed bin, fixed bin); call datebin_$dayr_mo (mo, da, yr, dayr); Arguments: mo is the month (1-12). (Input) da is the day of the month (1-31). (Input) yr is the year (1901-1999). (Input) dayr is the day of the year (1-366). (Output) :Entry: following_midnight: 02/06/84 datebin_$following_midnight Function: given a clock reading, returns a clock reading for midnight (local time) of that day. Syntax: declare datebin_$following_midnight entry (fixed bin(71), fixed bin(71)); call datebin_$following_midnight (oldclock, clock); Arguments: oldclock is a calendar clock reading in microseconds since January 1, 1901, 0000 GMT. (Input) clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Output) :Entry: last_midnight: 02/06/84 datebin_$last_midnight Function: returns a clock reading for the midnight (local time) preceding the current day. Syntax: declare datebin_$last_midnight entry (fixed bin(71)); call datebin_$last_midnight (clock); Arguments: clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Output) :Entry: next_shift_change: 02/06/84 datebin_$next_shift_change Function: given a clock reading, returns the time of the next shift change, the current shift, and the new shift. Syntax: declare datebin_$next_shift_change entry (fixed bin(71), fixed bin(71), fixed bin, fixed bin); call datebin_$next_shift_change (clock, newclock, shift, newshift); Arguments: clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Input) newclock is the time the shift changes next after clock. (Output) shift is the current shift at time clock. (Output) newshift is the shift that begins at time newclock. (Output) :Entry: preceding_midnight: 02/06/84 datebin_$preceding_midnight Function: given a clock reading, returns a clock reading for midnight (local time) of the preceding day. Syntax: declare datebin_$preceding_midnight entry (fixed bin(71), fixed bin(71)); call datebin_$preceding_midnight (oldclock, clock); Arguments: oldclock is a calendar clock reading in microseconds since January 1, 1901, 0000 GMT. (Input) clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Output) :Entry: revert: 02/06/84 datebin_$revert Function returns a calendar clock reading for the month, day, year, hour, minute, and second specified. Syntax: declare datebin_$revert entry (fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin, fixed bin(71)); call datebin_$revert (mo, da, yr, hr, min, sec, clock); Arguments: mo is the month (1-12). (Input) da is the day of the month (1-31). (Input) yr is the year (1901-1999). (Input) hr is the hour of the day (0-23). (Input) min is the minute of the hour (0-59). (Input) sec is the second of the minute (0-59). (Input) clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Output) :Entry: revertabs: 02/06/84 datebin_$revertabs Function: returns a calendar clock reading given the number of days since January 1, 1901. Syntax: declare datebin_$revertabs entry (fixed bin, fixed bin(71)); call datebin_$revertabs (absda, clock); Arguments: absda is the number of the days the clock reading represents (with January 1, 1901 = 1). (Input) clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Output) :Entry: shift: 02/06/84 datebin_$shift Function: returns the shift given a calendar clock reading. If clock is invalid, -1 is returned. Syntax: declare datebin_$shift (fixed bin(71), fixed bin); call datebin_$shift (clock, s); Arguments: clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Input) s is the shift, as defined in installation_parms. (Output) :Entry: this_midnight: 02/06/84 datebin_$this_midnight Function: returns a clock reading for midnight (local time) of the current day. Syntax: declare datebin_$this_midnight entry (fixed bin(71)); call datebin_$this_midnight (clock); Arguments: clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Output) :Entry: time: 02/06/84 datebin_$time Function: returns the hour, minute and second given a calendar clock reading. If clock is invalid, hr, min, and sec are -1. Syntax: declare datebin_$time entry (fixed bin(71), fixed bin, fixed bin, fixed bin); call datebin_$time (clock, hr, min, sec); Arguments: clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Input) hr is the hour of the day (0-23). (Output) min is the minute of the hour (0-59). (Output) sec is the second of the minute (0-59). (Output) :Entry: wkday: 02/06/84 datebin_$wkday Function: returns the day of the week (Monday = 1 ... Sunday = 7) given a calendar clock reading. If clock is invalid, 0 is returned. Syntax: declare datebin_$wkday entry (fixed bin(71), fixed bin); call datebin_$wkday (clock, wkday); Arguments: clock is a calendar clock reading with the number of microseconds since 0000 GMT January 1, 1901. (Input) wkday is the day of the week (1 = Monday, 7 = Sunday). (Output) ----------------------------------------------------------- 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