jsp - Comparing different format dates in javascript -
i have got date objects in jsp. 1 coming java page , other 1 coming same jsp.
formats of dates are:
wed may 07 00:00:14 cdt 2014 07-may-2014
now how compare these 2 dates, please help. don't know how convert these in javascript same format.
can please help?
why don't export date in java in same format javascript uses?
simpledateformat sdf = new simpledateformat("dd-mmm-yyyy");
or
simpledateformat sdf = new simpledateformat("eee mmm dd hh:mm:ss z yyy");
that way easier compare using:
var n = date1.localecompare(date2);
Comments
Post a Comment