Jump to content

[SOLVED] Calendars


rxbanditboy1112

Recommended Posts

So I am working on a weekly calendar. For example users could enter in a date (via a date selection gui), and then post an event or something. That portion I am used to and fine with. Now to display a weekly calendar of events that is what i am wondering about. I know php has many date functions, but this is how i could see this working. I could make the first day displayed be today's date's events. Then the next day is this day $i++, till i have seven. Then i am thinking alright well how about if people want to go to the next week (by clicking next or previous). I was thinking alright i would save the i value, and then have it keep adding but limiting it to 7 adds per weekly display.

 

What i am wondering is if i used $tomorrow  = mktime(0, 0, 0, date("m")  , date("d")+$i, date("Y")); could i just do that continuously without worrying about the month or the year? Does mktime automatically rollover? Has anyone had any experience with this, and has advice? Also does make time factor in leap years?

 

Thanks

Link to comment
Share on other sites

Actually i got it. According to the php manual. "mktime() is useful for doing date arithmetic and validation, as it will automatically calculate the correct value for out-of-range input. echo date("M-d-Y", mktime(0, 0, 0, 12, 32, 1997)); should actually correct it's input to what is appropriate.

 

Anyone have info about leap years?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.