I believe you are getting the correct answer according to ISO 8601.  It defines the first week of the year as the week with the first Thursday, or equivalently the first week that contains January 4th.  So that would mean that this year 1/1/2010 falls in the last week of 2009, week 53.<div>
<br></div><div><a href="http://en.wikipedia.org/wiki/ISO_week_date">http://en.wikipedia.org/wiki/ISO_week_date</a><br><br><div class="gmail_quote">On Wed, Jan 27, 2010 at 2:24 PM, Chris Romano <span dir="ltr">&lt;<a href="mailto:romano.chris@gmail.com">romano.chris@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On Wed, Jan 27, 2010 at 7:45 AM, Eli Heady &lt;<a href="mailto:eli.heady@gmail.com">eli.heady@gmail.com</a>&gt; wrote:<br>

&gt; On Tue, Jan 26, 2010 at 9:48 PM, Chris Romano &lt;<a href="mailto:romano.chris@gmail.com">romano.chris@gmail.com</a>&gt; wrote:<br>
&gt;&gt; I&#39;m running CentOS and using php 5.1.6<br>
&gt;&gt;<br>
&gt;&gt; There seems to be an issue with the date function.  I don&#39;t know if<br>
&gt;&gt; there is something on my end (coding) of it&#39;s a system issue.  Here is<br>
&gt;&gt; the code in question:<br>
&gt;&gt;<br>
&gt;&gt; $firstWeek = date(&quot;W&quot;,mktime(0,0,0,$month,1,$year));<br>
&gt;&gt;<br>
&gt;&gt; which for January would be something like this<br>
&gt;&gt; $firstWeek = date(&quot;W&quot;,mktime(0,0,0,01,1,2010));<br>
&gt;&gt;<br>
&gt;&gt; When this code is ran, $firstWeek is being set to 53.  It should be<br>
&gt;&gt; set to 01.  The code works perfect if the year is 2009.<br>
&gt;&gt;<br>
&gt;&gt; Any ideas?<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Chris<br>
&gt;<br>
&gt; Same here: php 5.3.1 (suhosin patched)<br>
&gt;<br>
&gt; Occurs every six years, then in the following year the week is off by -2<br>
&gt;<br>
&gt; A quick search revealed an issue with similar timing, due to daylight<br>
&gt; saving time: <a href="http://bugs.php.net/bug.php?id=29065" target="_blank">http://bugs.php.net/bug.php?id=29065</a><br>
&gt;<br>
&gt; It is suggested in that bug report to use gmmktime or gmdate instead.<br>
&gt; Is that an option for you?<br>
&gt;<br>
&gt; date(&quot;W&quot;,gmdate(0,0,0,01,1,2010));<br>
&gt; seems to work as expected<br>
<br>
Well that doesn&#39;t work.<br>
<br>
<br>
$firstWeek = gmdate(&quot;W&quot;,gmmktime(0,0,0,1,1,2010));<br>
print &quot;First Week = $firstWeek&lt;br&gt;&quot;;<br>
<br>
prints<br>
<br>
First Week = 53<br>
<br>
Not sure what&#39;s going on now.<br>
<br>
Chris<br>
<font color="#888888"><br>
--<br>
&quot;They that would trade essential liberty for a little temporary safety<br>
deserve neither.&quot; -- Benjamin Franklin<br>
_______________________________________________<br>
wplug mailing list<br>
<a href="mailto:wplug@wplug.org">wplug@wplug.org</a><br>
<a href="http://www.wplug.org/mailman/listinfo/wplug" target="_blank">http://www.wplug.org/mailman/listinfo/wplug</a><br>
</font></blockquote></div><br></div>