struct tm -> time_t converter wanted

Dr. T. Andrews tanner at cdis-1.uucp
Wed Oct 19 22:48:44 AEST 1988


In article <8700 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn ) writes:
) 	time_t mktime(struct tm *timeptr);
) If the time cannot be represented, (time_t)-1 is returned.

On many machines, time_t seems to be a long integer number of seconds
since the beginning of 1970.  Which this (at the moment) seems handy,
the evil that programmers write lives long after them.

If any of the aforementioned evil lasts until 2038, we've got fun.
That's when our present time_t should become negative.  A more
clever interface might arrange a slightly different way to indicate
an error:
	int mktime(struct tm *tmptr, time_t *t)
returns 0 if it worked (*t filled in), or -1 if it fails.
-- 
...!bikini.cis.ufl.edu!ki4pv!cdis-1!tanner  ...!bpa!cdin-1!cdis-1!tanner
or...  {allegra killer gatech!uflorida decvax!ucf-cs}!ki4pv!cdis-1!tanner



More information about the Comp.lang.c mailing list