Checking for valid dates

1999-11-02 Thread Tubbs, Derric L

Is there a reasonably easy method to make sure that an entered date is
valid, I.E. is not 30 Jan 99?  I am using Time::Local to convert a date
entered through an HTML form into the epoch offset (or whatever you call it)
and would like to make sure that valid dates are entered.  Thanks

Derric L. Tubbs
CITIS Administrator
Boeing - Fort Walton Beach, Florida
[EMAIL PROTECTED]
(850)302-4494



Re: Checking for valid dates

1999-11-02 Thread Jeffrey Baker

"Tubbs, Derric L" wrote:
> 
> Is there a reasonably easy method to make sure that an entered date is
> valid, I.E. is not 30 Jan 99?  I am using Time::Local to convert a date
> entered through an HTML form into the epoch offset (or whatever you call it)
> and would like to make sure that valid dates are entered.  Thanks

Just because I'm curious, please explain what isn't valid about 30 Jan
99.

ObPerl: The Date::Calc module might be what you need.
-- 
Jeffrey W. Baker * [EMAIL PROTECTED]
Critical Path, Inc. * we handle the world's email * www.cp.net
415.808.8807



Re: Checking for valid dates

1999-11-02 Thread Michael J. Miller

I did this using a JavaScript function that runs before the form is
submitted to validate the date locally (in the client, using JavaScript
Date objects) before submission.  Has the side benefit of giving the
user real time feed back as well without a send back to the server 

Brgds,

Mike.

On Tue, 2 Nov 1999 10:33:22 -0800, Tubbs, Derric L wrote:

>Is there a reasonably easy method to make sure that an entered date is
>valid, I.E. is not 30 Jan 99?  I am using Time::Local to convert a date
>entered through an HTML form into the epoch offset (or whatever you call it)
>and would like to make sure that valid dates are entered.  Thanks
>
>Derric L. Tubbs
>CITIS Administrator
>Boeing - Fort Walton Beach, Florida
>[EMAIL PROTECTED]
>(850)302-4494
>




Re: Checking for valid dates

1999-11-02 Thread Jeffrey Baker

"Michael J. Miller" wrote:
> 
> I did this using a JavaScript function that runs before the form is
> submitted to validate the date locally (in the client, using JavaScript
> Date objects) before submission.  Has the side benefit of giving the
> user real time feed back as well without a send back to the server 
> 
> Brgds,
> 
> Mike.

You still have to check it on the server side, unless you are willing to
let bad data slip into your database or wherever.

(Think user with JS turned off or simply submitting via LWP)

-jwb
-- 
Jeffrey W. Baker * [EMAIL PROTECTED]
Critical Path, Inc. * we handle the world's email * www.cp.net
415.808.8807



Re: Checking for valid dates

1999-11-03 Thread Michael J. Miller

True.  For general or public use, this would be a big issue. However,
we use this for an intranet/extranet application, and strictly control
who (and what and where also) can access the http servers.  Eventually
the whole mess gets put into Oracle on the back end via a package
procedure (in a datetime field), and if bad data did get past the web
app the update process would bomb as there are checks within the
package for this also.

As with everything, YMMV.

Brgds,

Mike

.
On Tue, 02 Nov 1999 18:36:25 -0800, Jeffrey Baker wrote:

>"Michael J. Miller" wrote:
>> 
>> I did this using a JavaScript function that runs before the form is
>> submitted to validate the date locally (in the client, using JavaScript
>> Date objects) before submission.  Has the side benefit of giving the
>> user real time feed back as well without a send back to the server 
>> 
>> Brgds,
>> 
>> Mike.
>
>You still have to check it on the server side, unless you are willing to
>let bad data slip into your database or wherever.
>
>(Think user with JS turned off or simply submitting via LWP)
>
>-jwb
>-- 
>Jeffrey W. Baker * [EMAIL PROTECTED]
>Critical Path, Inc. * we handle the world's email * www.cp.net
>415.808.8807
>




Re: Checking for valid dates <-- off topic!

1999-11-02 Thread Neil Kandalgaonkar

At 10:33 -0800 1999-11-02, Tubbs, Derric L wrote:
>Is there a reasonably easy method to make sure that an entered date is
>valid, I.E. is not 30 Jan 99?  I am using Time::Local to convert a date
>entered through an HTML form into the epoch offset (or whatever you call it)
>and would like to make sure that valid dates are entered.  Thanks

This isn't on topic. Could people please stick to the list topic? If you
are looking for general perl help, please try other avenues.


Anyway, as you may already know, Time::Local does not reject impossible dates.

[neil@tux neil]$ perl -MTime::Local -e 'print scalar localtime ( timelocal
(0,0,0,30,1,1999) ) . "\n"'
Tue Mar  2 00:00:00 1999

As usual, if you have a problem you know other people have dealt with you
should always check the CPAN  first.

Date::Calc has a check_date function.



--
Neil Kandalgaonkar [EMAIL PROTECTED]
Systems Architect, Stylus Inc.   http://www.stylus.ca/





RE: Checking for valid dates <-- off topic!

1999-11-02 Thread Tubbs, Derric L

Sorry about that, you're absolutely right.  I got several responses and they
solved my problem.  Thanks.  And now back to the topic ...

> --
> From: Neil Kandalgaonkar[SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, November 02, 1999 12:40 PM
> To:   Tubbs, Derric L; '[EMAIL PROTECTED]'
> Subject:  Re: Checking for valid dates <-- off topic!
> 
> At 10:33 -0800 1999-11-02, Tubbs, Derric L wrote:
> >Is there a reasonably easy method to make sure that an entered date is
> >valid, I.E. is not 30 Jan 99?  I am using Time::Local to convert a date
> >entered through an HTML form into the epoch offset (or whatever you call
> it)
> >and would like to make sure that valid dates are entered.  Thanks
> 
> This isn't on topic. Could people please stick to the list topic? If you
> are looking for general perl help, please try other avenues.
> 
> 
> Anyway, as you may already know, Time::Local does not reject impossible
> dates.
> 
> [neil@tux neil]$ perl -MTime::Local -e 'print scalar localtime ( timelocal
> (0,0,0,30,1,1999) ) . "\n"'
> Tue Mar  2 00:00:00 1999
> 
> As usual, if you have a problem you know other people have dealt with you
> should always check the CPAN <http://search.cpan.org/> first.
> 
> Date::Calc has a check_date function.
> 
> 
> 
> --
> Neil Kandalgaonkar [EMAIL PROTECTED]
> Systems Architect, Stylus Inc.   http://www.stylus.ca/
> 
> 
>