JULIANTIMESTAMP Procedure The JULIANTIMESTAMP procedure returns either a four-word, microsecond resolution, Julian-date-based timestamp or the number of microseconds elapsed since the last system load. The Julian calendar is the integral number of days since January 1, 4713 B.C. The formal definition of the Julian day states that it starts at 12:00 (noon), Greenwich mean time (GMT). retval := JULIANTIMESTAMP ( [ type ] ! i ,[ tuid ] ! o ,[ error ] ! o ,[ node ] ); ! i retval returned value FIXED is a value representing the number of microseconds since January 1, 4713 B.C., 12:00 (noon) GMT (Julian proleptic calender) unless type = 3. To convert this retval to a more usable form, use the INTERPRETTIMESTAMP procedure. If type = 3, the value returned is the number of microseconds since the last system load. To convert this retval to a more usable form, use the INTERPRETINTERVAL procedure. type input INT:value is one of the following values specifying the type of time requested: 0 Current GMT 1 System-load GMT 2 SYSGEN GMT 3 Microseconds since system load If type is not supplied, then type 0 is used. If type is out of range (that is, not 0, 1, 2, or 3), then a retval of -1F and an error of -1 are returned. tuid output INT:ref:1 is a time-update ID. This is used when calling the SETSYSTEMCLOCK procedure with relative GMT (see the SETSYSTEMCLOCK procedure). error output INT:ref:1 is returned only from a remote system with one exception: a value of -1 is returned when type is out of range. node input INT:value is the system number of the remote node from which you want the timestamp. CONSIDERATIONS * System message -10 (SETTIME) allows processes to determine the magnitude of and the reason for a time change. Refer to the Guardian Procedure Errors and Messages Manual for descriptions of interprocess system messages sent to processes. * A 64-bit Julian timestamp is based on the Julian Date. It is a quantity equal to the number of microseconds since January 1, 4713 B.C., 12:00 (noon) Greenwich mean time (Julian proleptic calendar). This timestamp can represent either Greenwich mean time, local standard time, or local civil time. There is no way to examine a Julian timestamp and determine which of the three times it represents. Procedures that work with the 64-bit Julian timestamp are COMPUTETIMESTAMP, CONVERTTIMESTAMP, INTERPRETTIMESTAMP, JULIANTIMESTAMP, and SETSYSTEMCLOCK. * A 48-bit timestamp is a quantity equal to the number of 10 millisecond units since 00:00, 31 December 1974. The 48-bit timestamp always represents local civil time (wall clock time), consequently, this value is affected by standard time/daylight saving time changes and time zone differences. Procedures which work with the 48-bit timestamp are: CONTIME, TIME, and TIMESTAMP. * Process creation time is initialized by calling TIMESTAMP, which returns the local civil time in centiseconds (0.01 second = 10 milliseconds) since midnight (00:00) on 31 December 1974, in an array of three words. Only the two low-order words are saved in the process control block (PCB); this is sufficient to make the unnamed process ID unique. * The RCLK instruction ($READCLOCK in TAL) is another source of timestamps. It returns a 64-bit timestamp representing the local civil time in microseconds since midnight (00:00) on 31 December 1974. Note that this is not a Julian timestamp. * Process timing uses 64-bit elapsed time counters with microsecond resolution; these are not Julian timestamps either. * There is no way to generalize about internal timing using 64-bit Julian timestamps or 48-bit timestamps. Each section of the operating system manages time using the method most appropriate for its application. * All time and calendar units in this discussion are defined in The Astronomical Almanac published annually by the U.S. Naval Observatory and the Royal Greenwich Observatory. * Because processor clocks are not synchronized to the nearest microsecond, values obtained from different processors might not agree. EXAMPLE MY^TIME := JULIANTIMESTAMP; ! returns the current GMT SYNTAX FOR C PROGRAMMERS #include long long JULIANTIMESTAMP ( [ short type ] ,[ short *tuid ] ,[ short *error ] ,[ short node ] );