Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Relative Time momentjs

moment("20111031", "YYYYMMDD").fromNow(); // 11 years ago
moment("20120620", "YYYYMMDD").fromNow(); // 10 years ago
moment().startOf('day').fromNow();        // an hour ago
moment().endOf('day').fromNow();          // in a day
moment().startOf('hour').fromNow();       // an hour ago
Source by momentjs.com #
 
PREVIOUS NEXT
Tagged: #Relative #Time #momentjs
ADD COMMENT
Topic
Name
1+3 =