Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-17 Thread Nicholas Robinson
And the reason I quoted 'usual' is that my suggestion is more portable. On Thursday 14 Aug 2003 11:54 am, Ford, Mike [LSS] wrote: On 13 August 2003 20:05, Nicholas Robinson wrote: On Wednesday 13 Aug 2003 8:00 pm, Scott Fletcher wrote: Hi! Here's a trick script. We know that some

RE: [PHP] Validate The Last Day of Month with server's clock????

2003-08-17 Thread Ralph Guzman
?php // check last day of september $month = '08'; $year = date(Y); $last_day = date(t, mktime (0,0,0, $month,1,$year)); print $last_day; ? -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 12:00 PM To: [EMAIL PROTECTED] Subject: [PHP]

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread CPT John W. Holmes
From: Nicholas Robinson [EMAIL PROTECTED] 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

[PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Scott Fletcher
Hi! Here's a trick script. We know that some months have the last day which is 30 while other is 31. As for February, it can be either 28 or 29. So, what's the trick in using the php to find out what is the last day of the month if you want to checked it against the server's clock to find

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Scott Fletcher
Alright, interesting thought, never thought it would be possible. So, what would the PHP script be when matching it against the clock or something? Perhap mktime(). Anyone know? Scott F. Nicholas Robinson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The 'usual' trick is to set the

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Scott Fletcher
Ah! that seem nicer when just using the script ($month+1)... Cpt John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] From: Nicholas Robinson [EMAIL PROTECTED] The 'usual' trick is to set the date to the first day of the month after the one you want and then subtract

RE: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Ford, Mike [LSS]
On 14 August 2003 16:01, Scott Fletcher wrote: Mike Ford [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 13 August 2003 20:05, Nicholas Robinson wrote: On Wednesday 13 Aug 2003 8:00 pm, Scott Fletcher wrote: Hi! Here's a trick script. We know that some

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Mike Migurski
Here's a trick script. We know that some months have the last day which is 30 while other is 31. As for February, it can be either 28 or 29. So, what's the trick in using the php to find out what is the last day of the month if you want to checked it against the server's clock to find out

RE: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Ford, Mike [LSS]
On 13 August 2003 20:05, Nicholas Robinson wrote: On Wednesday 13 Aug 2003 8:00 pm, Scott Fletcher wrote: Hi! Here's a trick script. We know that some months have the last day which is 30 while other is 31. As for February, it can be either 28 or 29. So, what's the trick in

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Nicholas Robinson
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. HTH Nick On Wednesday 13 Aug 2003 8:00 pm, Scott Fletcher wrote: Hi! Here's a trick script. We know that some months have the last day which is 30 while other is 31.

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Scott Fletcher
True but I just only want the day date, don't want the number of seconds. Mike Ford [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 13 August 2003 20:05, Nicholas Robinson wrote: On Wednesday 13 Aug 2003 8:00 pm, Scott Fletcher wrote: Hi! Here's a trick script. We

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Scott Fletcher
Did a lot of searching on the internet and found a simple PHP code that does the trick. How the code work is when you pick a month where you want the last day to be in, then use the next month into the PHP script to get the last day of the month you're looking for. --snip-- //Want to