Path: utzoo!utgpu!water!watmath!clyde!att!whuts!homxb!hropus!ki4pv!cdis-1!tanner From: tanner@cdis-1.uucp (Dr. T. Andrews) Newsgroups: comp.lang.c Subject: Re: struct tm -> time_t converter wanted Summary: running out of long integers for time_t Keywords: C library, time Message-ID: <6964@cdis-1.uucp> Date: 19 Oct 88 12:48:44 GMT References: <442@grand.UUCP> <8700@smoke.BRL.MIL> Organization: CompuData Inc, DeLand Lines: 17 In article <8700@smoke.BRL.MIL>, gwyn@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