I am working in an angular 4 application, Here I need to get the current Date and Time Using angular DatePipe.
I want to get the date and time
let dateFormat = require('dateformat');
let now = new Date();
dateFormat(now, "ffffdd, mmmm dS, yyyy, h:MM:ss TT");
Thursday, May 10th, 2018, 7:11:21 AM
And this format is exactly like your question
dateFormat(now, "dd, mm, yyyy, h:MM:ss TT");
returns 10, 05, 2018 7:26:57 PM
you need npm package npm i dateformat
here is a link for the npm package https://www.npmjs.com/package/dateformat
Here is another question that inspires me How to format a JavaScript date
h:MM:ss TT results 7:26:57 PM
HH:MM:ss results 13:26:57
I hope that helps.