Jump to content

Count Days From 'Today' Till Reoccurring Event


Recommended Posts

It's me again!  ;D

 

Before I even attempt to try and get this going, I was hoping someone could even tell me if it is possible. I was interested in having a count of the days between the current date and that of a reoccurring event (example: third Monday of every month).

 

If this is possible, what is the best way to go about setting up the database portion. I am trying to track various meetings of an organization.

 

Building Committee

Meets 3rd Monday Each Month

7:00 pm - 9:00 pm

 

Thanks,

Abraham

No problem  :D

 

I can get todays date automatically, so that is all set. I see the function you sent for getting the reoccurring date, but how do I get and store that in my database... or is it generated strictly through PHP?

 

... I'm slow when it comes to understanding this.  :P

you have two option ... sql or php

 

in sql you need this

insert into tablename values ('val1','val2','val3','val4','select datediff('now()',yourgivendate) form table limit 1')

 

or do a select in manipulate in php

 

select datediff('now()',yourgivendate) form table limit 1

 

some stuff here to get the result

then insert here ......

I honestly am still unsure how I get the value for the 3rd Monday in January (01/21/08). If this is something that I have to manually enter every month then that won't work unfortunately.  :-[

It's easy to get the first of the month, figure out what day of the week that is, add the difference to the first monday, then add 2 weeks.

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.