EJo EJo - 1 year ago 70
jQuery Question

Inbuild Functionality to Format Dates using Jquery

I have a requirement to show a date in the format as below in the label control.

Wednesday 20 Jul 2016 11:31 AM

Is there any in build functionality available with Jquery without righting my on function to build the string in the specific way as above?

Answer Source

You can use date.format library:

var dateFormat = require('dateformat');
var now = new Date();
dateFormat(now, "dddd dS mmmm yyyy h:MM TT");

It will return

Wednesday 20 Jul 2016 11:31 AM
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download