Outlook: Having 52/53 weeks in a year at random, but having to pay twice a year for an "half-week".ISO8601: Having 53 weeks once in a while, but every single one of them is 7 days long.Which one of those options would you prefer: ISO8601 weeks are guaranteed to be 7 days long which is why we need a leap-week every 4/5/6 years. That's an awfully short billing period for a week. For example, OW01-2010 is compromised of only 2 days: Fri Jan 1, Sat Jan 2. The problem with the Outlook way of counting is that a week is not guaranteed to be 7 days. In fact, if you look at your taxes that you are going to fill this year, they will describe the last fiscal year as being 53 weeks long. Outlook's week numbering is somewhat equivalent to the following: $dummyWeek = floor((date('z') + (date('N') - 1)) / 7) + 1 įor billing purposes, you are better off using ISO8601 as a standard. If you have any customers that complain, simply refer them to the standard. Fact is you are following an international standard for date and time formatting and counting ( ISO8601). I don't think you will have an issue here. Is it correct to have 53 weeks? We have both European and US clients. If so, then why PHP can't support it? Did anyone make a function that supported this? Is this another standard? The US standard or something? If you look into MS Outlook, and show day of the week in the calendar view, it will appear 52 weeksĬonsidering to week 1. is 2009-W53-4 (ISO year 2009 has 53 weeks, extending the Gregorian year 2009, which starts and ends with Thursday, at both ends with three days).Īnd the date function in PHP totally respects it. That's one thing I didn't know, and probably many didn't as well. It seems that through the Gregorian calendar within 400 years there are 71 years that have 53 weeks. I'm using PHP aka date('W') to get the week number from a date, that calculates that according to the standard ISO-8601.īut here's the ISSUE: year 2009 has 53 weeks. I recently came across a big problem, as I have a system that's paying the customers weekly.Īs we all know, a year has 52 weeks, and there are standards for it.
0 Comments
Leave a Reply. |