You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dave Jones <JO...@er6s1.eng.ohio-state.edu> on 2000/01/03 18:47:32 UTC

Re: ap_current_time() is not intuitive

In message <00...@raleigh.ibm.com>,
  Bill Stoddard <st...@raleigh.ibm.com> writes:
>
>Can we collapse the ap_current_time() function into either ap_make_time or
>ap_get_curtime()? Here is how you use APR to get the current time today:
>
>ap_make_time(&time, p);
>ap_current_time(time);
>ap_get_curtime(time, &thetime);
>
>ap_make_time creates the ap_time_t structure. Then ap_current_time() makes
>the underlying system call to initialize the ap_time_t structure. Then
>ap_get_curtime returns the time in seconds since 1/1/1970.  Note that
>ap_get_curtime is not getting the current time, it is getting the time from
>when ap_current_time was called. This is non-intutitive as hell.

Why not rename ap_get_curtime() to something more descriptive of what it
is actually doing (converting a time value from one representation to another)?
I don't have a good suggestion because I don't know the preferred short-hand
way of saying 'seconds since 1/1/1970', which I always just called 'unix time'.

-----------------------------------------------------------------------------
David L. Jones               |      Phone:    (614) 292-6929
Ohio State University        |      Internet:
140 W. 19th St. Rm. 231a     |               jonesd@er6s1.eng.ohio-state.edu
Columbus, OH 43210           |               vman+@osu.edu

Re: ap_current_time() is not intuitive

Posted by rb...@apache.org.
> > This is actually pretty descriptive of what we are doing.  We are grabbing
> > the current time from the time object.
> 
> Eh? Surely we're grabbing whatever time happens to be there, which may
> or may not be the current time?

Sorry, what I said really did make sense to me.  :-)  Yes, we are grabbing
the time that is stored in that time object, whether or not it is the
current time.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
6209 H Shanda Dr.
Raleigh, NC 27609		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------


Re: ap_current_time() is not intuitive

Posted by Ben Laurie <be...@algroup.co.uk>.
rbb@apache.org wrote:
> 
> > Why not rename ap_get_curtime() to something more descriptive of what it
> > is actually doing (converting a time value from one representation to another)?
> > I don't have a good suggestion because I don't know the preferred short-hand
> > way of saying 'seconds since 1/1/1970', which I always just called 'unix time'.
> 
> This is actually pretty descriptive of what we are doing.  We are grabbing
> the current time from the time object.

Eh? Surely we're grabbing whatever time happens to be there, which may
or may not be the current time?

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi

Re: ap_current_time() is not intuitive

Posted by rb...@apache.org.
> Why not rename ap_get_curtime() to something more descriptive of what it
> is actually doing (converting a time value from one representation to another)?
> I don't have a good suggestion because I don't know the preferred short-hand
> way of saying 'seconds since 1/1/1970', which I always just called 'unix time'.

This is actually pretty descriptive of what we are doing.  We are grabbing
the current time from the time object.  The only thing I could recommend
as a different name would be get_unix_time, and I don't like this, because
it makes us sound less portable.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
6209 H Shanda Dr.
Raleigh, NC 27609		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------