November 1st, 1999, 08:43 AM
is there a way to get the weekday from the MySQL date format yyyy/mm/dd??
November 1st, 1999, 08:50 PM
First chop the MySQL date up into three variables - $year, $month and $day.
Then use a combination of the mktime() and date() commands. Mktime can turn $month/$day/$year into a Unix timestamp and then date() turns the timestamp into a string formatted however you like. For example:
$weekday = date("l", mktime(0,0,0,$month,$day,$year));
Will print out the day of the week spelled in full.
Check the manual for details on the date and mktime functions.