On Tue, 2002-02-05 at 14:11, DL Neil wrote:
> toni,
> 
> > $date1 = "10/12/2002";
> > $date1 = date("D M j Y", strtotime($date1));
> > $date2 = date("D M j Y");
> > $date3 = date("D M j Y", $date1);
> > print $date1."<br>";
> > print $date2."<br>";
> > print $date3."<br>";    
> > 
> > The code above gives me the following output:
> > 
> > Fri Oct 11 2002
> > Mon Feb 4 2002
> > Wed Dec 31 1969
> > 
> > Is the strtotime() function causing this problem?
> 
> 
> =yes, in a way. Please RTFM:
> strtotime -- Parse about any English textual datetime description into a UNIX 
>timestamp
>    
> The function expects to be given a string containing an English date
>      format and will try to parse that format into a UNIX timestamp relative
>      to the timestamp given in now, or the current time
>      if none is supplied. Upon failure, -1 is returned.
> 
> =The -1 explains $date3, it also enables you to back-track to an issue with $date1. 
> 
> =If you are in America, what does 10/12 mean?
> =If you are in Europe, what does 10/12 mean?
> =Thus, how can strtotime() attempt to determine the meaning of the textual date? 
> (I'll send you the full lecture if you have no idea what I'm talking about)

No offense, but in TFM (which you have of course R), follow the 'Date 
Input Formats' link to:

   http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html

You will find this sentence:

   The construct 'month/day/year', popular in the United States, is
   accepted. 

In other words, '10/12/2002' should work fine with strtotime(). The
problem is elsewhere.


Torben

> =Regards,
> =dn
 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to