sintax63 Posted December 20, 2007 Share Posted December 20, 2007 It's me again! 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 Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 20, 2007 Share Posted December 20, 2007 datediff('now()',yourgivendate) Quote Link to comment Share on other sites More sharing options...
sintax63 Posted December 20, 2007 Author Share Posted December 20, 2007 But is it possible for PHP to figure out what date the 3rd Monday of January is? Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 20, 2007 Share Posted December 20, 2007 yes.. Quote Link to comment Share on other sites More sharing options...
sintax63 Posted December 21, 2007 Author Share Posted December 21, 2007 Wow - that is really awesome! Any idea what the field for the reoccurring date in my database should be? Another date field so I have two? Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 21, 2007 Share Posted December 21, 2007 sorry i dont understand I'm slow when it comes to engslish Quote Link to comment Share on other sites More sharing options...
sintax63 Posted December 21, 2007 Author Share Posted December 21, 2007 No problem 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. Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 21, 2007 Share Posted December 21, 2007 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 ...... Quote Link to comment Share on other sites More sharing options...
sintax63 Posted December 21, 2007 Author Share Posted December 21, 2007 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. Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 21, 2007 Share Posted December 21, 2007 you look for date() mktime() that two function is all you need .. Quote Link to comment Share on other sites More sharing options...
fenway Posted December 21, 2007 Share Posted December 21, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.