php_b34st Posted September 5, 2008 Share Posted September 5, 2008 How would I count how many weeks it has been since a set starting date? if the starting date was sat 16th august and I check on sat 6th september it should be week 4. thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/122898-solved-counting-weeks/ Share on other sites More sharing options...
BlueSkyIS Posted September 5, 2008 Share Posted September 5, 2008 if you convert each date to a timestamp and subtract the earlier one from the later one, that will give you the number of seconds between the dates. you can then divide by 60 for minutes, 60 again for hours, 24 for days, then 7 for weeks between. i'd probably use mktime() or strtotime() to make the timestamps. Quote Link to comment https://forums.phpfreaks.com/topic/122898-solved-counting-weeks/#findComment-634760 Share on other sites More sharing options...
php_b34st Posted September 5, 2008 Author Share Posted September 5, 2008 Thank you Quote Link to comment https://forums.phpfreaks.com/topic/122898-solved-counting-weeks/#findComment-634775 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.