S
soup_or_power
Hi
I have a requirement to compare the user entry for mm/dd/yy/HH/mm
(month, day, year, hour, minute) to the Easter Standard Time.
I am using the following script, but it is not giving the right answer.
Your kind help is appreciated. Thank you!
//this is what user enters
var gdate = new Date(f.year.value, f.month.value, f.day.value,
f.hour.value, f.min.value);
var EST_offset = -4
var num_msecs = gdate.getTime()+ gdate.getTimezoneOffset() * 60000
+ EST_offset *3600000;
//the current time of the desk top depends on location
var gdate2 = new Date();
var num_msecs2 = gdate2.getTime()+ gdate2.getTimezoneOffset() *
60000;
//we don't know the offset from GMT! What does getTimezoneOffset
return?
if (num_msecs < num_msecs2) {
alert("Schedule time has to be in the future");
return false;
}
I have a requirement to compare the user entry for mm/dd/yy/HH/mm
(month, day, year, hour, minute) to the Easter Standard Time.
I am using the following script, but it is not giving the right answer.
Your kind help is appreciated. Thank you!
//this is what user enters
var gdate = new Date(f.year.value, f.month.value, f.day.value,
f.hour.value, f.min.value);
var EST_offset = -4
var num_msecs = gdate.getTime()+ gdate.getTimezoneOffset() * 60000
+ EST_offset *3600000;
//the current time of the desk top depends on location
var gdate2 = new Date();
var num_msecs2 = gdate2.getTime()+ gdate2.getTimezoneOffset() *
60000;
//we don't know the offset from GMT! What does getTimezoneOffset
return?
if (num_msecs < num_msecs2) {
alert("Schedule time has to be in the future");
return false;
}