Check out example codes for "moment format sql date". It will help you in understanding the concepts better.

Code Example 1

moment(new Date()). format("YYYY-MM-DD HH:mm:ss");

Learn ReactJs, React Native from akashmittal.com