Incredinot Posted December 18, 2009 Share Posted December 18, 2009 Hi.. I am trying to achieve somthing, but cant really figure out how to do it. Some part of me is telling me thats it "rather simple", but ofcourse its now, then i would've figured it out instead of asking :b So what i want is a calender.. Ive found a rather short coded one here, and it is fine for what i need. http://www.plus2net.com/php_tutorial/php_calendar.php?prm=11&chm=-1 Now what i want is to push another style into dates where i have information. I have all this information stored in a database. My database is like: Dates -> id Timestamp Information So... Lets say we are able to se the whole calender for december right 2009 now. Then at the 24 december i have a timestamp thats "xxxx" and information thats "xxxx" in my database. The < td > tag should then instead contain a style that ill define. Lets say $style_with = "style=\"background-color:#f00;\"> $style_without = "style=\"background-color:#fff;\"> Then i what i want is roughly: If date is NOT in db - {echo $style_without;}. If date IS in db - {echo $style_with;}. So how can i tell "if the date is greater than 24 december 00:00 and less than 25 december 23:59"? Hope someone could help me out.. That would be the best christmas gift this year :b Merry christmas! Link to comment https://forums.phpfreaks.com/topic/185571-php-calender-how-can-i-do-this/ Share on other sites More sharing options...
teynon Posted December 18, 2009 Share Posted December 18, 2009 I like MySQL's timestamps for comparison and you can do so in PHP. $date=date("YmdHis", strtotime($time)); You can use this and "mktime" to work with dates. I'm in Iraq and don't have the ability to make everything for you so read up on that. Link to comment https://forums.phpfreaks.com/topic/185571-php-calender-how-can-i-do-this/#findComment-979712 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.