[PATCH] gmtime man page

Brian Ford Brian.Ford@flightsafety.com
Thu Jul 20 16:03:00 GMT 2006


The gmtime man page says it assumes the time at clock represents a local
time, and that it converts it to UTC.  This is not true.  clock is the
standard time_t representation of seconds elapsed since 00:00:00 on
January 1, 1970, UTC, thus it is not a local time and no UTC conversion
occurs.

2006-07-19  Brian Ford  <Brian.Ford@FlightSafety.com>

	* libc/time/gmtime.c: Correct man page; clock is not a
	local time and no conversion occurs.

-- 
Brian Ford
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained crew...
-------------- next part --------------
Index: libc/time/gmtime.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/time/gmtime.c,v
retrieving revision 1.2
diff -u -p -r1.2 gmtime.c
--- libc/time/gmtime.c	17 Apr 2002 21:23:31 -0000	1.2
+++ libc/time/gmtime.c	19 Jul 2006 16:41:24 -0000
@@ -29,11 +29,11 @@ TRAD_SYNOPSIS
 	struct tm *<[res]>;
 
 DESCRIPTION
-<<gmtime>> assumes the time at <[clock]> represents a local time.
-<<gmtime>> converts it to UTC (Universal Coordinated Time, also known in some
-countries as GMT, Greenwich Mean time), then converts the
-representation from the arithmetic representation to
-the traditional representation defined by <<struct tm>>.
+<<gmtime>> takes the time at <[clock]> representing the number
+of elapsed seconds since 00:00:00 on January 1, 1970, Universal
+Coordinated Time (UTC, also known in some countries as GMT,
+Greenwich Mean time) and converts it to a <<struct tm>>
+representation.
 
 <<gmtime>> constructs the traditional time representation in static
 storage; each call to <<gmtime>> or <<localtime>> will overwrite the


More information about the Newlib mailing list