4.3BSD-Tahoe/usr/man/cat3/gmtime.0

Compare this file to the similar file:
Show the results in this format:




CTIME(3)	    UNIX Programmer's Manual		 CTIME(3)



NNAAMMEE
     ctime, localtime, gmtime, asctime, timezone, tzset -  con-
     vert date and time to ASCII

SSYYNNOOPPSSIISS
     vvooiidd ttzzsseett(())

     cchhaarr **ccttiimmee((cclloocckk))
     ttiimmee__tt **cclloocckk;;

     ##iinncclluuddee <<ttiimmee..hh>>

     cchhaarr **aassccttiimmee((ttmm))
     ssttrruucctt ttmm **ttmm;;

     ssttrruucctt ttmm **llooccaallttiimmee((cclloocckk))
     ttiimmee__tt **cclloocckk;;

     ssttrruucctt ttmm **ggmmttiimmee((cclloocckk))
     ttiimmee__tt **cclloocckk;;

     cchhaarr **ttiimmeezzoonnee((zzoonnee,, ddsstt))

DDEESSCCRRIIPPTTIIOONN
     _T_z_s_e_t uses the value of the environment variable TTZZ to set
     up the time conversion information used by _l_o_c_a_l_t_i_m_e.

     If TTZZ does not appear in the environment, the TTZZDDEEFFAAUULLTT file
     (as defined in _t_z_f_i_l_e._h) is used by _l_o_c_a_l_t_i_m_e.  If this file
     fails for any reason, the GMT offset as provided by the ker-
     nel is used.  In this case, DST is ignored, resulting in the
     time being incorrect by some amount if DST is currently in
     effect.  If this fails for any reason, GMT is used.

     If TTZZ appears in the environment but its value is a null
     string, Greenwich Mean Time is used; if TTZZ appears and
     begins with a slash, it is used as the absolute pathname of
     the _t_z_f_i_l_e(5)-format file from which to read the time
     conversion information; if TTZZ appears and begins with a
     character other than a slash, it's used as a pathname rela-
     tive to the system time conversion information directory,
     defined as TTZZDDIIRR in the include file _t_z_f_i_l_e._h.  If this file
     fails for any reason, the GMT offset as provided by the ker-
     nel is used, as described above.  If this fails for any rea-
     son, GMT is used.

     Programs that always wish to use local wall clock time
     should explicitly remove the environmental variable TTZZ with
     _u_n_s_e_t_e_n_v(3).

     _C_t_i_m_e converts a long integer, pointed to by _c_l_o_c_k, such as
     returned by _t_i_m_e(3), into ASCII and returns a pointer to a



Printed 7/9/88	       September 30, 1987			1






CTIME(3)	    UNIX Programmer's Manual		 CTIME(3)



     26-character string in the following form.  All the fields
     have constant width.

	 Sun Sep 16 01:03:52 1973\n\0

     _L_o_c_a_l_t_i_m_e and _g_m_t_i_m_e return pointers to structures contain-
     ing the broken-down time.	_L_o_c_a_l_t_i_m_e corrects for the time
     zone and possible daylight savings time; _g_m_t_i_m_e converts
     directly to GMT, which is the time UNIX uses.  _A_s_c_t_i_m_e con-
     verts a broken-down time to ASCII and returns a pointer to a
     26-character string.

     The structure declaration from the include file is:

	  struct tm {
	       int tm_sec;    /* 0-59  seconds */
	       int tm_min;    /* 0-59  minutes */
	       int tm_hour;   /* 0-23  hour */
	       int tm_mday;   /* 1-31  day of month */
	       int tm_mon;    /* 0-11  month */
	       int tm_year;   /* 0-    year - 1900 */
	       int tm_wday;   /* 0-6   day of week (Sunday = 0) */
	       int tm_yday;   /* 0-365 day of year */
	       int tm_isdst;  /* flag: daylight savings time in effect */
	       char **tm_zone;	       /* abbreviation of timezone name */
	       long tm_gmtoff;	       /* offset from GMT in seconds */
	  };

     _T_m__i_s_d_s_t is non-zero if a time zone adjustment such as Day-
     light Savings time is in effect.

     _T_m__g_m_t_o_f_f is the offset (in seconds) of the time represented
     from GMT, with positive values indicating East of Greenwich.

     _T_i_m_e_z_o_n_e remains for compatibility reasons only; it's impos-
     sible to reliably map timezone's arguments (_z_o_n_e, a "minutes
     west of GMT" value and _d_s_t, a "daylight saving time in
     effect" flag) to a time zone abbreviation.

     If the environmental string _T_Z_N_A_M_E exists, _t_i_m_e_z_o_n_e returns
     its value, unless it consists of two comma separated
     strings, in which case the second string is returned if _d_s_t
     is non-zero, else the first string.  If _T_Z_N_A_M_E doesn't
     exist, _z_o_n_e is checked for equality with a built-in table of
     values, in which case _t_i_m_e_z_o_n_e returns the time zone or day-
     light time zone abbreviation associated with that value.  If
     the requested _z_o_n_e does not appear in the table, the differ-
     ence from GMT is returned; e.g. in Afghanistan, _t_i_m_e_z_o_n_e(-
     (_6_0*_4+_3_0), _0) is appropriate because it is 4:30 ahead of
     GMT, and the string GGMMTT++44::3300 is returned.	Programs that in
     the past used the _t_i_m_e_z_o_n_e function should return the zone
     name as set by _l_o_c_a_l_t_i_m_e to assure correctness.



Printed 7/9/88	       September 30, 1987			2






CTIME(3)	    UNIX Programmer's Manual		 CTIME(3)



FFIILLEESS
     /etc/zoneinfo	      time zone information directory
     /etc/zoneinfo/localtime  local time zone file

SSEEEE AALLSSOO
     gettimeofday(2), getenv(3), time(3), tzfile(5), environ(7)

NNOOTTEE
     The return values point to static data whose content is
     overwritten by each call.	The ttmm__zzoonnee field of a returned
     ssttrruucctt ttmm points to a static array of characters, which will
     also be overwritten at the next call (and by calls to
     _t_z_s_e_t).










































Printed 7/9/88	       September 30, 1987			3