Re: parse date field
| From: | Lester Caine | Date: | Thu, 14 Jan 2010 10:10:52 +0000 |
| Subject: | Re: parse date field | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301093@lists.php.net to get a copy of this message | ||
John Taylor-Johnston wrote:
How do I parse a date field from mysql? I was hoping this would work: $mydata->birthday = "2007-02-13"; This just stores a string to the variable $mydata->birthday - where did you define $mydata->birthday as a data object?$mydata->birthday = date("2007-02-13");
#What month is it? echo date("F", $mydata->birthday); #What year is it? echo date("Y", $mydata->birthday); What am I missing? All I get is December 1969. Hmmm? I am looking at the manual: http://ca.php.net/manual/en/function.date.php http://ca.php.net/manual/en/function.mktime.php http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html-- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php