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