moment js for time code example Example 1: npm momen npm i moment Example 2: moment to javascript date let now = moment() let now = now.toDate()