News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell's Blog:
Getting Dates from Week Numbers in PHP
November 30, 1999 @ 00:00:35

Lorna Mitchell has a quick handy post to her blog today showing how you can grab the date (a timestamp) from the week number of the year.

Recently I've been building a little project that pulls data from Google Analytics and shows your web statistics in a simple form. One thing I wanted to do was show the data for a quarter, but graphing by day is too chaotic and graphing by month only gives three points, so I wanted to graph by week. This was fine but the data returned by Analytics only gives me the week numbers, and since this project is aimed at demystifying web stats for normal people, it really needs normal dates on it!

Thanks to the DateTime functionality built in to PHP and the setIsoDate function, pulling the date back is a simple single call away. She also points out the reverse - using the "W" in a date call to return the week.

0 comments voice your opinion now!
tutorial date weeknumber datetime setisodate


blog comments powered by Disqus

Similar Posts

Rashaud Teague's Blog: Basic Data Trees

Phish Tank: Install & Configure Apache+PHP+ZendFramework+OracleDbXe On Windows In Minutes

DevShed: Generating Web Pages in Multiple Languages with a PHP IP-to-Country Mapping Application

DZone.com: Using a stream wrapper to access CouchDb attachments with PHP

NetTuts.com: Protect a CodeIgniter Application Against CSRF


Community Events





Don't see your event here?
Let us know!


conference symfony voicesoftheelephpant security laravel tool series artisanfiles opinion version list community introduction framework composer library language release interview podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework