Reply to Re: Date, beginning of week

Your name:

Reply:


Posted by Steve on 03/02/07 16:19

| > ok...just saw the the end date should be the last second of sunday. add
| > this
| > as your final line of code:
| >
| > $sunday = strtotime(date('m/d/Y', $sunday) . ' 24:59:59');

NOTE!!!

'ADD this as your FINAL line of code:'


| Am I missing soothing here, the Monday is correct, but I can't see how you
| are working out the Sunday, if I run the script I get the following

all is well. perhaps i should not give directions, but instead give code.
here's the uncommented, fully-complete code:

$today = strtotime(date('m/d/Y') . ' 00:00');
$monday = strtotime('last monday', $today);
if (intval(strftime('%w', $today)) != 0) {
$monday = strtotime('last monday', $monday);
}
$sunday = strtotime('next sunday', $monday);
$sunday = strtotime(date('m/d/Y', $sunday) . ' 23:59:59');

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация