VMS Help  —  CRTL  gettimeofday
    Gets the date and time.

    Format

      #include  <time.h>

      int gettimeofday  (struct timeval *tp, void *tzp);

1  –  Arguments

 tp

    Pointer to a timeval structure, defined in the <time.h> header
    file.

 tzp

    A NULL pointer. If this argument is not a NULL pointer, it is
    ignored.

2  –  Description

    The gettimeofday function gets the current time (expressed as
    seconds and microseconds) since 00::00 Coordinated Universal
    Time, January 1, 1970. The current time is stored in the timeval
    structure pointed to by the tp argument.

    The tzp argument is intended to hold time-zone information set
    by the kernel. However, because the OpenVMS kernel does not
    set time-zone information, the tzp argument should be NULL. If
    it is not NULL, it is ignored. This function is supported for
    compatibility with BSD programs.

    If the value of the SYS$TIMEZONE_DIFFERENTIAL logical is wrong,
    the function fails with errno set to EINVAL.

3  –  Return Values

    0                  Indicates success.
    -1                 An error occurred. errno is set to indicate
                       the error.
Close Help