>Why WEEK({^2004-12-31}) return 1 instead of 53
In Bata/Bolivia, I couldn't quite figure out if there was a well-defined rule, how the week numbering was defined in the company (i.e., which was the first week of the year). So, to have the maximum flexibility, I ended up creating a table, indicating which was the first week of each year (weeks stored as the date of the first day of the week, of week #1), and functions to convert from dates to week numbers, and back again, with the help of this table.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)