This is a comparison of PHP's date() week functionality (e.g.,
date('W')) versus MySQL's WEEK() modes. The MySQL columns below are the mode
for WEEK(), not the version of MySQL! I ignored the modes that started on Sunday.
| Date | PHP | MySQL mode 1 | MySQL mode 3 | MySQL mode 5 | MySQL mode 7 |
|---|---|---|---|---|---|
| 2008-7-1 | 27 | 27 | 27 | 26 | 26 |
| 2008-12-1 | 49 | 49 | 49 | 48 | 48 |
| 2008-12-7 | 49 | 49 | 49 | 48 | 48 |
| 2008-12-8 | 50 | 50 | 50 | 49 | 49 |
| 2008-12-21 | 51 | 51 | 51 | 50 | 50 |
| 2008-12-22 | 52 | 52 | 52 | 51 | 51 |
| 2008-12-28 | 52 | 52 | 52 | 51 | 51 |
| 2008-12-29 | 01 | 53 | 1 | 52 | 52 |
| 2008-12-30 | 01 | 53 | 1 | 52 | 52 |
| 2008-12-31 | 01 | 53 | 1 | 52 | 52 |
| 2009-1-1 | 01 | 1 | 1 | 0 | 52 |