I am having problems with the date references I am using in my script. Firstly I am creating a date value via a form in one page using the following:
$theday = mktime(0,0,0,date("m"),date("d")+$i,date("Y"));
$value = date("Y-m-d",$theday);
The variable $value being the date string that I send to the mysql database. In the database it seems to be entered in the correct format and displaying in mysql as YYYY-MM-DD.
I am then trying to extract this date and display it on another page as a text string using the following:
$display_date = date("l jS F Y",$date);
where $date has been allocated the value taken from the database.
Then when I display the string $display_date it always shows:
Thursday 1st January 1970
Can anybody see where I am going wrong? I am reasonably new to PHP and MYSQL but I have always had problems with using dates when entering into a database when I previously used ColdFusion!