Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watmath.UUCP Path: utzoo!watmath!atbowler From: atbowler@watmath.UUCP (Alan T. Bowler [SDG]) Newsgroups: net.lang.c Subject: Re: ANSI 'C'. Message-ID: <247@watmath.UUCP> Date: Wed, 27-Nov-85 12:14:23 EST Article-I.D.: watmath.247 Posted: Wed Nov 27 12:14:23 1985 Date-Received: Thu, 28-Nov-85 03:47:29 EST References: <447@graffiti.UUCP> <538@brl-sem.ARPA> <170@watmath.UUCP> <628@sftig.UUCP> Reply-To: atbowler@watmath.UUCP (Alan T. Bowler [SDG]) Organization: U of Waterloo, Ontario Lines: 26 Summary: In article <628@sftig.UUCP> lr@sftig.UUCP (L.Rosler) writes: >Perhaps it is unrealistic to expect people who state what the "ANSI >standard is specifying" to have read it. The draft actually says, >"The gmtime function returns ... a null pointer if GMT is not available." >The presumption is that if the time() function works at all (see my >previous posting on THAT subject), then it is reasonable to expect >localtime() to work also. If gmtime() is available, it must work >as specified; otherwise it fails in a specified way. In other words, >"If you are going to supply gmtime functionality, do it like this...". Ooops, I missed the line about GMTIME returning a NULL. Thank you for pointing it out. (Now, hopefully having extracted my foot from my mouth (-: ) LOCALTIME, however, is still expected to return a flag saying wheither or not daylight savings time is in effect. Does, "The local time zone and Daylight Savings Time are implementation defined." mean that I can redefine what the term "Daylight Savings Time" means and always set the value zero? This seems like a no win situation. On related problem, even assuming I have access to a daylight savings flag, LOCALTIME, is supposed to return the daylight savings flag for some arbitrary time_t value it is given. Is this supposed to be today's flag, or the value it would have had on the date being referenced? As has been discussed before there is no algorithm that will predict when daylight time is in effect since it is in many places under control of local politicians. Is there some reading of the standard, or some more lines that can be added telling me what to implement on a machine which has no access to a daylight savings time flag.