View Single Post
Old 03-27-2011, 07:00 PM   #1 (permalink)
mjwalsh
The Wanderer
 
Join Date: Dec 2008
Location: Houston, TX
Posts: 14
Thanks: 1
mjwalsh is on a distinguished road
Default PHP Calendar Displaying Wrong Date

At this point I have coding goggles and am certain I must be missing something dumb.. My calendar is displaying that the first day of March was on a Wednesday, however it wasn't, it was on a Tuesday. Any ideas on what could be causing this? ( I already verified that the servers timezone was set correct )

PHP Code:
 $cal_date  time(); 
  
 
$cal_day   date('d'$cal_date); 
 
$cal_month date('n'$cal_date); 
 
$cal_year  date('Y'$cal_date); 
  
 
$first_day mktime(000$cal_month1$cal_year); 
  
 
$title     date('F'$first_day); 
  
 
$cal_day_of_week date('D'$fist_day); 
Basically "$cal_day_of_week" is returning as "Wed" when it should return as "Tue".
Send a message via AIM to mjwalsh Send a message via MSN to mjwalsh
mjwalsh is offline  
Reply With Quote