L4ndy Posted October 24, 2008 Share Posted October 24, 2008 Hi Folks, I am quite a novice on PHP and scripting in general so, apologies in advance for not being specific on my question. My query is, I have the following script: function getFirstDayOfWeek($year, $weeknr) { $offset = date('w', mktime(0,0,0,1,1,$year)); $offset = ($offset < 5) ? 1-$offset : 8-$offset; $monday = mktime(0,0,0,1,1+$offset,$year); return strtotime('+' . ($weeknr - 1) . ' weeks', $monday); It's part of a Resource booking system PHP script which basically allows users to book any resources for any given Day and Period. The main page of the system is divided into Weeks, days and periods. Now the problem is that after a few weeks the starting day of the week sudenly became Sunday as oposed to Monday as you can see on the picture attached below. Is there anything obvious I need to change on the script to always make Monday the starting day of the week?? Thanks in advance [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.