Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,255
Total Threads: 81,221
Total Posts: 566,957
There are 216 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

PHP Calendar Displaying Wrong Date

Thread title: PHP Calendar Displaying Wrong Date
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
03-27-2011, 08:23 PM
#1
mjwalsh is offline mjwalsh
mjwalsh's Avatar
Status: I love this place
Join date: Dec 2007
Location:
Expertise: Programming - Sys Admin
Software: Dreamweaver - Notepad++
 
Posts: 638
iTrader: 14 / 100%
 

mjwalsh is on a distinguished road

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

     


Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed