Re: date HELP !!!!!
| From: | James Holloway | Date: | Mon, 23 Jul 2001 08:04:39 +0000 |
| Subject: | Re: date HELP !!!!! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59149@lists.php.net to get a copy of this message | ||
Better still, use the date("t"); to find out how many days are in the given
month. This part of the date function is a blessing, given the varying days
in months, and the fact that we've a leap year every four years.
James
"Daniel Rezny" <daniel@rezny.sk> wrote in message
news:1005096518.20010723095203@rezny.sk...
> Hello Yamin,
>
> Monday, July 23, 2001, 9:27:46 AM, you wrote:
>
> YP> hi,
> YP> how do i check that the current date is the end of month
>
> YP> Thanks in Advance
>
>
> If you want to check how long is current month and use this value
> later you can use this:
>
> $month=("m"); //can be like this depend on if you scrolling between
> moths. If yes variable $month must be recieved from link.
>
> $d=27;
> while ($d <= 32) {
> $mon = date("m",mktime(0,0,0,$month,$d,$rok));
> if ($month != $mon) {
> $daylast = $d-1; $d=33;
> }
> else {
> $d++;
> }
> }
>
> I hope it helps.
> --
> Best regards,
> Daniel mailto:daniel@rezny.sk
>