1// Shows if one date is gerater than the other returns True/False.
2var date1 = '2015-08-20 09:38:20';
3var date2 = '2015-08-20 08:00:00';
4var date1Updated = new Date(date1.replace(/-/g,'/'));
5var date2Updated = new Date(date2.replace(/-/g,'/'));
6console.log(date1Updated > date2Updated);