Blog Archives

PHP date('W') versus MySQL WEEK()

Recently I just retrofitted some code that was using week numbers for reporting out some values. Unfortunately, the year's end brought to light some issues related to a difference in how PHP and MySQL calculated the week number. To that end, I created the following table to show that PHP's date('W') seems to be equivalent to MySQL's WEEK() function using mode #3.

PHP and MySQL's week functionality compared

Posted: January 13, 2009 @ 16:29
Tagged: code, mysql, php, tech

Comments

No comments have been added