CLOCK


ANSI

 

The CLOCK instruction retrieves operational or system configuration information, including the date, time and port number. The instruction uses the following format:

 

 

[label]

CLOCK

{item}{sep}{dest}

 

Where:

label

Optional. A Program Execution Label.

item

Required. A valid clock information parameter from the list below.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

dest

Required. A previously defined Character String Variable or Numeric Variable.

Flags Affected: EOS, OVER

Note the following:

  1. {dest} is the destination variable that receives the result of the CLOCK instruction. Normally, {dest} is a character string variable. However, there are two CLOCK instructions under PLBCMP that require a numeric destination variable.

  2. Transfer of the information into {dest} is treated like a MOVE.

  3. Linux systems do not return a hundredths of a second value.

  4. The PLBCE runtime does not support the ENV, DAY, SECONDS, SYSTEM, or CPUTIME operations.

  5. The PLB_CLOCKDATE runtime keyword modifies the behavior of the DATE operation.

  6. The supported CLOCK operations ({item}), the variable type required and the maximum return information size follows:

  7.  

    Operation

    Returns the ...

    DATE

    current system date (character string - mm-dd-yy).

    DAY

    current system day (character string - ddd).

    ENV

    environment table variables (character string).(non-ANSI)

    ERROR

    last error code that occurred (character string). The string will include the WINERR value and the file name if applicable.

    INI

    retrieves the value associated with the keyword specified in {dest} from the current ini file. (non-ANSI)

    PORT

    current system port ID and screen characteristics (character string - 51 byte max., first 2 (or 3) bytes are port ID 'nn').

    SYSPORT

    unique system port ID on certain multi-user systems or the standard port ID on all others (character string - 12 byte max.). (non-ANSI)

    TIME

    current system time (character string - hh:mm:ss.pppppp). PL/B for Linux is accurate to the microsecond. Windows returns zeros for each of the last three digits and is only accurate to the millisecond.

    TIMESTAMP

    current system date and time (character string - yyyymmddhhmmsspppppp). PL/B for Linux is accurate to the microsecond. Windows returns zeros for each of the last three digits and is only accurate to the millisecond.

    VERSION

    retrieves the current name and version of the library/run-time/interpreter for the executing program (character string - 31 byte max.).

    WEEKDAY

    current day of week number (Sunday = 1,...,Saturday = 7).

    WINDOW

    current subwindow coordinates and the current cursor coordinates.(non-ANSI)

    YEAR

    current system year (character string - yy).

     

  8. The following CLOCK operations are supported by PLBCMP and not by SUNDB86x:

  9.  

    Operation

    Returns the ...

    CPUTIME

    accumulated CPU time for the process in microseconds (numeric - 1 byte minimum, maximum depends on accumulated time). (non-ANSI)

    SECONDS

    retrieves the number of seconds since 12:00am 01/01/70 (numeric - 4 bytes (INTEGER) or 10 bytes (FORM)). (non-ANSI)

    SYSDATE

    retrieves the system day, date, time, time zone, and a daylight savings time indicator (character string - Mon Apr 18 16:00:00 1986 -0600, 33 byte character string required or no result). (non-ANSI).

     

  10. The daylight savings time field has a size of two (2) characters with a leading blank and is reported as "00", "01", or "-1". The "00" value indicates that the time is reported as standard time and daylight saving time is not in effect. The "01" value indicates that the time is reported and the daylight saving time is in effect. The "-1" value indicates that the status of the daylight saving time is unknown. (9.5)

  11. The timezone field is adjusted for the daylight saving time only when the daylight saving time is in affect.

  12. If the Windows configuration disables the automatic daylight saving time, the timezone field for the CLOCK SYSDATE instruction is not available from the OS functions. In this case the timezone field is reported as zero.

 

 

See Also: Example Code, System Interface Instructions

 



PL/B Language Reference CLIPSET COPYBYTES