[drupal-devel] date conversion

Gordon Heydon gordon at heydon.com.au
Mon Jun 13 09:23:22 UTC 2005


Hi,
On Mon, 2005-06-13 at 06:59 +0200, Gerhard Killesreiter wrote:
> 
> On Mon, 13 Jun 2005, Gordon Heydon wrote:
> 
> > I was wondering if anyone knows of a decent method of converting dates
> > from text to a time.
> >
> > I did look at strtotime() but it will not convert anything before Jan 1,
> > 1970 which is a problem since it is going to be used for a date of birth
> > field, and some people will be over 35.
> 
> Note: The valid range of a timestamp is typically from Fri, 13 Dec
>      1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the
>      dates that correspond to the minimum and maximum values for a
>      32-bit signed integer.)
> 
> (from my version of the php manual entry for strtotime)
> 
> print strtotime("60 years ago");
> 
> gives me -774821398.

Well that gives me on both my ubuntu and debian linux systems both give
me -1, It does say on the php site that it is windows and some linux
distributions.

So if I use strtotime('31 Dec 1969') I get a -1, If it was giving me the
rangi that it would say it would me ok.

Thanks.

Gordon




More information about the drupal-devel mailing list