Skip to content

Instantly share code, notes, and snippets.

@epicserve
Created November 12, 2013 18:48

Revisions

  1. epicserve created this gist Nov 12, 2013.
    17 changes: 17 additions & 0 deletions js_date_test2.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    var date1 = new Date();
    var date2 = new Date(2099, 10, 11);

    console.log(date1);
    console.log(date2);
    console.log(date1 >= date2);
    console.log(date1 <= date2);
    console.log(date1 == date2);
    console.log(date1 === date2);

    // $ node js_date_test.js
    // Tue Nov 12 2013 10:47:30 GMT-0800 (PST)
    // Wed Nov 11 2099 00:00:00 GMT-0800 (PST)
    // false
    // true
    // false
    // false