Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

momentjs

moment("20111031", "YYYYMMDD").fromNow(); // 11 years ago
moment("20120620", "YYYYMMDD").fromNow(); // 10 years ago
moment().startOf('day').fromNow();        // 20 hours ago
moment().endOf('day').fromNow();          // in 4 hours
moment().startOf('hour').fromNow();       // 10 minutes ago
Source by momentjs.com #
 
PREVIOUS NEXT
Tagged: #momentjs
ADD COMMENT
Topic
Name
7+1 =