In javascript solution
Be sure to set hrs, min, secs and milliseconds to 0 if you just want to compare dates (e.g. day, month and year). The function to achieve the above is as follows,
function f_tcalResetTime (d_date) { d_date.setHours(0); d_date.setMinutes(0); d_date.setSeconds(0); d_date.setMilliseconds(0); return d_date; }
If you are comparing dates, javascript actually calls the date.valueOf function backstage, which returns the number of milliseconds that have passed since midnight on January 1, 1970.
Vinod T. Patil
source share