JavaScript Date.UTC() with a month off by one

It’s like they say – there are two difficult things in Computer Science: naming things, invaliding cache, and off-by-one errors.  Today I came across a weird issue with JavaScript’s Date.UTC() shifting the month by one.  The day and year were fine, but the month was off by one.  Interesting, considering that the date was parsed from a standard MySQL date (like 2013-07-12).   Well, another thing they say: when all else fails, read the manual.  And that’s where the solution is:

Parameters

  • year: A year after 1900.
  • month: An integer between 0 and 11 representing the month.
  • date: An integer between 1 and 31 representing the day of the month.

Fun.

PHP.net design updated

php.net

 

It’s been a long time pending, but finally, PHP.net updated the design of the website.  The new one doesn’t look anymore that it was done in 1974.  It’s fresh, nice, yet keeps somewhat of the same familiar feeling of the old one.  The search box looks to be updated as well.  I can’t say for sure, since I have a custom search on all my browsers to direct any search query that starts with “php” to php.net.  But it looks like now when you search, the completion will tell you what the dropdown results are – functions, books, etc.