I have a date stored as yyyy/mm/dd. I have been trying for ages to change the format of the date and everything has failed for me. I know how to apply a query to change the date format but I cant seem to get that to work coz it interferes with my other sql statements.
I then decided to write this function below but this is displaying the following error on my web page:
Fatal error: Cannot redeclare gettimestamp() (previously declared in /users///public_html/cinema/owner/moviesshowing.php:99) in /users///public_html/cinema/owner/moviesshowing.php on line 99
The code is as follows:
function GetTimeStamp($MySqlDate)
{
/
Take a date in yyyy-mm-dd format and return it to the user
in a PHP timestamp
/
$date_array = explode("-",$MySqlDate); // split the array
$var_year = $date_array[0];
$var_month = $date_array[1];
$var_day = $date_array[2];
$var_timestamp = mktime(0,0,0,$var_month,$var_day,$var_year);
return($var_timestamp); // return it to the user
}
I would really really appreciate help with this? I have spend so long at it and I’ve got nowhere.
Thank you
Kind Regards.