TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-27-2011, 07:00 PM   #1 (permalink)
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
Old 03-27-2011, 08:36 PM   #2 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

The only problem that i can see is the typo $fist_day should be "$first_day".
codefreek is offline  
Reply With Quote
Old 03-28-2011, 05:53 AM   #3 (permalink)
The Wanderer
 
Join Date: Dec 2008
Location: Houston, TX
Posts: 14
Thanks: 1
mjwalsh is on a distinguished road
Default

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!)
Send a message via AIM to mjwalsh Send a message via MSN to mjwalsh
mjwalsh is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Event to PHP Calendar buildakicker General 21 01-29-2013 12:01 PM
PHP Access Date problems. mtsang Absolute Beginners 4 06-27-2009 04:59 PM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
what method do you use with php when displaying a stylesheet? sarmenhb Absolute Beginners 9 01-08-2009 02:36 PM
Nginx Rewrite Causing Wrong Path for PHP Script stewart General 0 11-09-2008 12:32 AM


All times are GMT. The time now is 06:25 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design