Link to home
Start Free TrialLog in
Avatar of saturation
saturation

asked on

Convert SQL date to Javascript date to compare

I need to convert a date from SQL Server in the following format to Javascript like below

var createddate = 'Sun Nov 9 00:00:00 CST 2008';

var dteNow = new Date();
sMonth = (dteNow.getMonth()+1);
sDay = (dteNow.getDate() - 7);
sYear = dteNow.getYear();
sHours = dteNow.getHours();
sDayThisWeek = sMonth + "" + sDay + "" + sYear;
sActDate = sMonth + "/" + sDay + "/" + sYear;


so I can compare using this:

if (createddate < dteActDate) {
      alert("YES");
}

How do I do this?
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial