how to format date with moment react code example Example: moment time ago format reactjs console.log(moment("2018-09-04T18:30:00.000Z").fromNow())