Jump to content

Count Days From 'Today' Till Reoccurring Event


sintax63

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.