Re: Validate The Last Day of Month with server's clock????
| From: | Scott Fletcher | Date: | Wed, 13 Aug 2003 20:25:52 +0000 |
| Subject: | Re: Validate The Last Day of Month with server's clock???? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159485@lists.php.net to get a copy of this message | ||
Ah! that seem nicer when just using the script ($month+1)...
"Cpt John W. Holmes" <holmes072000@charter.net> wrote in message
news:00f401c361d2$3e6579d0$a629089b@TBHHCCDR...
> From: "Nicholas Robinson" <npr@bottlehall.freeserve.co.uk>
>
> > The 'usual' trick is to set the date to the first day of the month after
> the
> > one you want and then subtract one day.
>
> Along those same lines, this works:
>
>
> <?php
>
> $month = 12;
> $year = 2003;
>
> $last_day_of_month = mktime(12,0,0,$month+1,0,$year);
>
> echo date('m/d/Y',$last_day_of_month);
>
> ?>
>
> ---John Holmes...
>