Re: [PHP] parse date field

2010-01-14 Thread Michael Kjeldsen
On 01/14/2010 11:01 AM, John Taylor-Johnston wrote: How do I parse a date field from mysql? I was hoping this would work: $mydata->birthday = "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

Re: [PHP] parse date field

2010-01-14 Thread John Taylor-Johnston
Super, thanks. 5:14 a.m. - My head is fogging :p vikash wrote: Use strttotime() function. This will work as intended. $mydata->birthday = strtotime("2007-02-13"); #What month is it? echo date("F", $mydata->birthday); #What year is it? echo date("Y", $mydata->birthday); On Thu, Jan 14, 2010 at

Re: [PHP] parse date field

2010-01-14 Thread Lester Caine
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");

Re: [PHP] parse date field

2010-01-14 Thread vikash . iitb
Use strttotime() function. This will work as intended. $mydata->birthday = strtotime("2007-02-13"); #What month is it? echo date("F", $mydata->birthday); #What year is it? echo date("Y", $mydata->birthday); - -- Vikash Kumar http://vika.sh On Thu, Jan 14, 2010 at 3:31 PM, John Taylor-Johnston <

[PHP] parse date field

2010-01-14 Thread John Taylor-Johnston
How do I parse a date field from mysql? I was hoping this would work: $mydata->birthday = "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: ht