ANSI 'C'.

Alan T. Bowler [SDG] atbowler at watmath.UUCP
Thu Nov 28 03:14:23 AEST 1985


In article <628 at sftig.UUCP> lr at 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.



More information about the Comp.lang.c mailing list