LOCALTIME - obtain local time.

(ANSI Standard)

Usage:

#include <time.h>
loctim = localtime(clock);

Where:

const time_t *clock;
is a time number as returned by the "time" function.
struct tm *loctim;
is a time structure as described below.

Description:

"localtime" expands a time number into a structure containing a number of integers giving time values. The structure includes the following elements:

struct tm {
/* ANSI standard fields */
   int tm_sec;   /* 0 to 60 */
   int tm_min;   /* 0 to 59 */
   int tm_hour;  /* 0 to 23 */
   int tm_mday;  /* 1 to 31 */
   int tm_mon;   /* 0 to 11 */
   int tm_year;  /* year - 1900 */
   int tm_wday;  /* Sunday = 0 */
   int tm_yday;  /* 0 to 365 */
   int tm_isdst;
       /* >0 if Daylight Savings Time,
        *  0 if Standard,
        * <0 if unknown */
/* extensions to ANSI standard */
   char *tm_zone;  /* time zone name    */
   long tm_gmtoff; /* offset from GMT   */
};

In this way, you can obtain any particular component of the date or time.

Notes:

The NS mode C library determines GMT using the time zone definition file of the UW Tools package. For further information, see "expl b tz".

Notes:

Calls to other date/time functions may indirectly change values in the "tm" structure indicated by the "loctim" pointer.

See Also:

expl nsc lib time

expl nsc lib asctime

Copyright © 1996, Thinkage Ltd.