Re: String to time
| From: | Jim Winstead | Date: | Mon, 12 Jul 1999 20:08:25 +0000 |
| Subject: | Re: String to time | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-8415@lists.php.net to get a copy of this message | ||
Is there any reason that the latest parsedate.y from INN wasn't used?
I would prefer that one because it has a clear statement that it has
been released into the public domain, and it presumably has improvements
not in this older version.
Jim
Nick Sayer wrote:
>
> I have just finished another loadable function. This one is an
> interface to a routine I swiped out of C-news a long time ago.
> It's a YACC thing called 'getdate'. You give it a free form date
> string and it turns it into a time_t. It also accepts offset style
> date input, such as "now + 1 minute". It takes as input a time value
> to be used as the base for such relative time strings.
>
> My strtotime() function takes either 1 or 2 arguments. The first is
> the string, the second is an optional timeval (the default is the
> current time if this argument is left out). It returns a timeval,
> or -1 if the input specifies an illegal time (years must be 1970-2099,
> the way I compiled it. As it was in C-news, years beyond 2000 didn't work,
> but the fix was simple).
>
> I can provide it to anyone who is interested. I didn't find a similar
> function in the manual (at least one whose input was as free-form). If
> it exists, then tell me and watch me turn beet red. :-)