from 0 to 11.
Use new Date(yyyy,mm,dd,hh,nn,ss) to create a date and getTime() to
compare two dates numerically. You can use setFullYear(), setMonth() &
setDate() to set year, month and date with the values of the text field
for your second object. Use split() and parseInt() on the value to get
them.
Pascal
> -----Original Message-----
> From: Jeff Waris [mailto:[EMAIL PROTECTED]
> Sent: 13 October 2004 20:47
> To: CF-Talk
> Subject: OT: _javascript_ Date/Time help!
>
> I can handle this with CF no problem, but I have an instance where I
need
> to
> make a DATE and TIME comparison with the server time BEFORE a form
gets
> submitted. I figure the best way to handle this is in the form of some
> _javascript_ validation. I know _javascript_ but I am no expert by any
means.
>
> Here is what I got:
> -I can pull the current form date entry with
> document.myForm.dueDate.value.
> -Everyone enters the date in MM/DD/YYYY on the form.
> -I can make a _javascript_ variable of the current server DATE using
> createdate() CF function.
> -I can make a _javascript_ variable of the current server TIME as well
using
> the CF function createtime().
> -I can pull from my database a CUTOFF time in HH:MM:SS from my
database.
>
> Now for the tuff part. Using _javascript_, I need to combine the FORM
DATE
> and
> CURRENT SERVER TIME into a single _javascript_ variable, lets call it
> FORMDATE_TIME. I then need to take the CURRENT SERVER DATE and compine
it
> with the DATABASE's CUTOFF TIME into another _javascript_ variable as
> CUTOFFDATE_TIME.
>
> Once I have those variables, I want to return true if the
FORMDATE_TIME is
> less than the CUTOFFDATE_TIME and return false if not.
>
> Any help or point in the right direction from any _javascript_ gurus
would
> be
> appreciated...
>
> Thanks.
> Jeff
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

