A
anagai
I just want to check if a date entered in a textbox is equal to the
current system date. I set the date object from the input field like
this:
dt1=new Date('10/01/2007');
the current system date is retrieved like this:
curDt = new Date();
Lets say that today is same date as 10/1/07. When you view both
variables they are exactly the same, but when i convert the dates to
milliseconds using getTime() function the curDt value has a few more
milliseconds added to it for some reason. So if user entered todays
date the code would never detect if it is todays date. This seems to
be somekind of bug. Im using firefox 2.0.0.7 browser.
if(dt1==curDt) // this will never equal because the system date
always adds a few milliseconds to the date value
if(dt1.getTime==curDt.getTime()) //this will never equal either for
above reason.
has anybody ever seen this bug? This is a bug?
current system date. I set the date object from the input field like
this:
dt1=new Date('10/01/2007');
the current system date is retrieved like this:
curDt = new Date();
Lets say that today is same date as 10/1/07. When you view both
variables they are exactly the same, but when i convert the dates to
milliseconds using getTime() function the curDt value has a few more
milliseconds added to it for some reason. So if user entered todays
date the code would never detect if it is todays date. This seems to
be somekind of bug. Im using firefox 2.0.0.7 browser.
if(dt1==curDt) // this will never equal because the system date
always adds a few milliseconds to the date value
if(dt1.getTime==curDt.getTime()) //this will never equal either for
above reason.
has anybody ever seen this bug? This is a bug?