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
November 16, 2006 @ 15:13:37

Derick Rethans has posted a quick tip to his blog today:

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 (technically) three-line code uses ISO format for the date to tell you which day is the starting day of that week and which is the end. He only explains this format just a bit, so if you want more information, check out the strtotime function page.

0 comments voice your opinion now!
start day end week date strtotime iso format start day end week date strtotime iso format


blog comments powered by Disqus

Similar Posts

Slawek Lukasiewicz's Blog: Working with date and time in object oriented way

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

Derick Rethans\' Blog: php|tek conference

7PHP.com: How To Start A PHP User Group Hear It From Craig Willis Founder Of LeedsPHP Usergroup

David Goodwin's Blog: PHP DateTime vs mktime / strtotime in Propel


Community Events





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


community install deployment package api zendserver podcast series opinion bugfix interview voicesoftheelephpant unittest symfony language library framework introduction release laravel

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