News Feed
Sections




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

Derick Rethans' Blog:
Calculating start and end dates of a week
September 06, 2006 @ 07:03:24

With just a quick handy code snippet posted on his blog today, Derick Rethans shares these two lines to help grab the start and end dates of a week in question.

A friend asked "How do I calculate start (monday) and end (sunday) dates from a given week number for a specified year?" Instead of having to come up with your own algorithm you can simply do the following in PHP 5.1 and higher.

The code makes use of the ISO8601 datetime functionality to grab the correct value from a strtotime command. Derick also briefly explains how it all works.

0 comments voice your opinion now!
start date end week strtotime iso8601 datetime format start date end week strtotime iso8601 datetime format


blog comments powered by Disqus

Similar Posts

Ilia Alshanetsky\'s Blog: PHP 5.1.1 Released! (and a Rant)

Derick Rethans' Blog: Calculating start and end dates of a week

Yet Another Web Development Blog: A PHP Developer Spends a Week with Python

PHPBuilder.com: An introduction to PEAR's Validate package

Derick Rethans' Blog: Calculating start and end dates of a week


Community Events





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


voicesoftheelephpant composer opinion series threedevsandamaybe configure release podcast conference version laravel introduction interview language api unittest symfony list framework community

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