httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@raleigh.ibm.com>
Subject Re: ap_current_time() is not intuitive
Date Thu, 06 Jan 2000 12:17:09 GMT
On Wed, 5 Jan 2000, Bill Stoddard wrote:

> > On Windows:
> >     time_t
> >     SYSTEMTIME
> >
> I'd prefer to make time_t FILETIME rather than SYSTEMTIME. It's a bit more
> convenient and most accurate of the different representations.  And I'd like
> atime_t on Win32 have the following fields:

Please re-read what I wrote.  All I was saying, was that there were two
fields, time_t and a SYSTEMTIME.

> 
> struct atime_t {
>     ap_context_t cont;
>     FILETIME filetime; /* number of 100nS increments since 1/1/1601 */
>     SYSTEMTIME *explodedtime;
>     ap_int64_t  unixtime;  /* time in seconds since 1/1/70 */
> }

Having both a FILETIME and storing a unixtime is IMHO a very bad idea.
Because you will never know if somebody stored a value in the FILETIME
when you go to retrieve the unixtime, you will always have to convert from
FILETIME to unixtime.  Plus, the function that does the conversion is
incredibly simple and fast.  You should forget the unixtime and just do
the conversion whenever it is necessary.

> 
> ap_current_time would initialise the FILETIME (via
> GetSystemTimeAsFileTime())

I have never heard of this function, but if you found it, cool.

> > Could you please tell Microsoft that, because the only function I have
> > found to do get the current time on a system is GetSystemTime, and that
> > returns the equivalent of an expanded time on Windows.

> Bzzzzt, Wrong.  See above.

Can't be wrong.  It's a fact.  The only function I was able to find was
GetSystemTime.  Doesn't mean the other isn't there, it just means my copy
of MSDN (A few years old at this point) didn't make it obvious to me.  :-)

Ryan

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		

Come to the first official Apache Software Foundation
Conference!  <http://ApacheCon.Com/>




Mime
View raw message