Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gettimeofday(2) — DG/UX 5.4.2A

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

date(1)

settimeofday(2)

ctime(3C)



gettimeofday(2)                  DG/UX 5.4.2                 gettimeofday(2)


NAME
       gettimeofday - get date and time

SYNOPSIS
       #include <sys/time.h>

       int gettimeofday (timevalue, timezone)
       struct timeval * timevalue;
       struct timezone * timezone;

   where:
       timevalue     Address of a structure that will be set to the current
                      time.

       timezone      NULL or address of a structure that will be set to the
                      current time zone.

DESCRIPTION
       Gettimeofday returns the system's notion of the current Greenwich
       time and the current time zone to the structures at the locations
       specified by timevalue and timezone.

       If timezone is NULL, the current time zone is not returned.

       The time value returned is Greenwich time expressed in seconds and
       microseconds since midnight January 1, 1970.

       The local time zone is expressed in minutes of time westward from
       Greenwich (tzminuteswest), and a value (tzdsttime) that indicates
       the type of daylight savings time that applies locally during the
       appropriate part of the year.  The daylight savings time correction
       flag (tzdsttime) further indicates the type of daylight savings time
       correction to apply.  The accepted values are:

               DSTNONE        DST does not apply.
               DSTUSA         USA DST correction.
               DSTAUST        Australian DST correction.
               DSTWET         Western European DST correction.
               DSTMET         Middle European DST correction.
               DSTEET         Eastern European DST correction.

       The current local time may be computed using the current time zone by
       the following calculation:

       localusec = timevalue->tvusec;
       localsec = timevalue->tvsec - timezone->tzminuteswest * 60
                       + (isdst(timevalue,timezone) ? 60 * 60 : 0);

       where isdst(tv,tz) is some function that returns TRUE if daylight
       savings time is currently in effect.

ACCESS CONTROL
       None.




Licensed material--property of copyright holder(s)                         1




gettimeofday(2)                  DG/UX 5.4.2                 gettimeofday(2)


RETURN VALUE
       0      Completed successfully.

       -1     An error occurred.  errno is set to indicate the error.

DIAGNOSTICS
       Errno may be set to one of the following error codes:

       EFAULT    An argument address referenced invalid memory.

SEE ALSO
       date(1), settimeofday(2), ctime(3C).













































Licensed material--property of copyright holder(s)                         2


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026