TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   PHP Calendar Displaying Wrong Date (http://www.talkphp.com/general/5827-php-calendar-displaying-wrong-date.html)

mjwalsh 03-27-2011 07:00 PM

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".

codefreek 03-27-2011 08:36 PM

The only problem that i can see is the typo $fist_day should be "$first_day".

mjwalsh 03-28-2011 05:53 AM

I can't believe that happened, it's always something stupid :( Thanks codefreek! I can't believe that happened, it's always something stupid :( Thanks codefreek! (That resolved it!)


All times are GMT. The time now is 11:00 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0