1 . npm i moment 2. import moment from 'moment' 3. var date = moment(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss');