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?
saturationAsked:
Who is Participating?
 
hieloCommented:
try:

var createddate = 'Sun Nov 9 00:00:00 CST 2008';
createddate = new Date( Date.parse(createddate) );
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.