paulgobble Posted August 20, 2006 Share Posted August 20, 2006 Before I do a bunch of (probably unnecessary and redundant) coding, I thought I ask if anyone knows a simple way to do this.Given any date, I need to know the next "third Tuesday" that comes after it. I deal with a lot of groups that hold their meetings of the "second Monday" or "third Tuesday" of the month so I'd like to code reminders for them. After looking through the php.net docs, I found a lot of date functions but not something like this. Did I overlook something?Thanks,Paul Quote Link to comment Share on other sites More sharing options...
Barand Posted August 20, 2006 Share Posted August 20, 2006 You will need a custom function for that. If you want one I can post one. Quote Link to comment Share on other sites More sharing options...
sasa Posted August 20, 2006 Share Posted August 20, 2006 try[code]<?php$after = 3; // number of weeks$look_day = 4; // 0 is Sun, 1 is Mon etc$t=time();$d = date('w');$after = ($d >= $look_day) ? $look_day - $d + $after * 7 : $look_day - $d + --$after * 7;$t_new = $t + 86400 * $after;echo date('D d. M Y',$t_new);?>[code][/code][/code] Quote Link to comment Share on other sites More sharing options...
Barand Posted August 20, 2006 Share Posted August 20, 2006 I'll attach the function. If you prefer to write your own then don't look[attachment deleted by admin] 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.