moment time from now localization code example Example 1: moment js from now moment(date).fromNow(); Example 2: momentjs docs npm install moment