You are here: Re: Second Saturday? « All PHP « IT news, forums, messages
Re: Second Saturday?

Posted by kenrbnsn on 07/02/06 05:03

Joe wrote:
> My knowledge is poor, but I've been reading a bit and lurking for a
> while, and I wondered if it were possible to use PHP to display the date
> for the second Saturday in the current month, or if that has passed, the
> second Saturday for NEXT month.

You want to look at the time(), strtotime(), and date() functions.

Here is one way:
<?php
$today = time();
$sec_sat = (strtotime('2nd saturday this month') >
$today)?strtotime('2nd saturday this month'):strtotime('2nd saturday
next month');
echo date('l, F j, Y',$sec_sat);
?>

Ken

 

Navigation:

[Reply to this 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

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