note 36964 rejected from function.strtotime by didou
| From: | didou@php.net | Date: | Wed, 29 Oct 2003 09:09:30 +0000 |
| Subject: | note 36964 rejected from function.strtotime by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59459@lists.php.net to get a copy of this message | ||
Note Submitter: papejack@hotmail.com
----
I was trying to get a date from mySQL that was before 1st January 1970 (a birthdate) juste like
<b>kemps at free dot fr</b>. MySQL accepted the date very well in the query and it did
work OK. PHP can print the string of the date, but I've got a big bug when I wanted to
strtotime() the date.
The solution I've got is to format the date in the SQL query:
SELECT TbPersonnes.*,
YEAR(DateNaissance) AS Annee,
MONTH(DateNaissance) AS Mois,
DAYOFMONTH(DateNaissance) AS Jour
FROM TbPersonnes
WHERE NoPersonne = 5
So, like this, you can create a date in 3 fields....it's a little bit simple and I think it
suck that PHP doesn't support date before the 1st January 1970.
So that's all !