Hello,
Thanks for looking at my post. I have been working at formating a date in PHP from a MYSql table. I am a newbie to MYSql and PHP so bare with me.
The date is stored in a field called cal_begin. The format it is stored in is 2003-08-18 which is far as I know is the only format PHP will store it in. I have written a php script which successfully connects to the database and extracts the field which it displays in the format as indicated above.
What I want to do is format the date like "August 18, 2003". So far I have tried a number of strings without success. The below string displays the date however as December 31, 1969 irrespective of what value is in the table column.
echo date('F d, Y','$cal_begin');
I have searched the PHP site as well as several books and cannot find an answer as to how to format the value of a date or time field. There is quite a bit of documentation on how to format a variable but not field output. Everything I have tried has failed.
If anyone can help me out on this it would be greatly appreciated.
Rick
Thanks for looking at my post. I have been working at formating a date in PHP from a MYSql table. I am a newbie to MYSql and PHP so bare with me.
The date is stored in a field called cal_begin. The format it is stored in is 2003-08-18 which is far as I know is the only format PHP will store it in. I have written a php script which successfully connects to the database and extracts the field which it displays in the format as indicated above.
What I want to do is format the date like "August 18, 2003". So far I have tried a number of strings without success. The below string displays the date however as December 31, 1969 irrespective of what value is in the table column.
echo date('F d, Y','$cal_begin');
I have searched the PHP site as well as several books and cannot find an answer as to how to format the value of a date or time field. There is quite a bit of documentation on how to format a variable but not field output. Everything I have tried has failed.
If anyone can help me out on this it would be greatly appreciated.
Rick