Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!sbcs!sbpmt!altman From: altman@sbpmt.cs.sunysb.edu (Jeff Altman) Newsgroups: comp.windows.ms.programmer Subject: Re: tzset and Windows Message-ID: <1991Mar27.203753.20851@sbcs.sunysb.edu> Date: 27 Mar 91 20:37:53 GMT References: <1991Mar27.020414.2525@sbcs.sunysb.edu> Sender: usenet@sbcs.sunysb.edu (Usenet poster) Organization: State University of New York at Stony Brook Lines: 21 Well, it wasn't a windows problem. Its a problem with unclear documentation in Borland C++ (and probably every other C Library reference manual.) The problem is that gmtime and localtime both return pointers to structures that the manual refers to as static structures that are re-written with each call. What the manual does NOT say is that gmtime and localtime both use the SAME static structure. So: gmt = gmtime(&t) ; lt = localtime(&t) ; printf (asctime(lt)) ; printf (asctime(gmt)) ; both use the localtime value. -- - Jeff (jaltman@ccmail.sunysb.edu)