Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date time comparison

Status
Not open for further replies.

jgos

Programmer
Sep 27, 2002
38
0
0
US
I have a form that has a date field and a time field. I want to check to see if the date field = the current day, and if so, is the time field less than the current time. Does anyone have any example scripts that do this kind of validation?
 
dt=new Date()
//i may have forgotten some 's'

dd=dt.getDate()// or getDay() current date
mm=dt.getMonths()// or getMonth()
yy=dt.getYear()

//current time
hh=dt.getHours()
mm=dt.getMinutes()


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top