0

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?

EJo
  • 227
  • 3
  • 13

3 Answers3

1

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
Tuan-IT
  • 131
  • 1
  • 11
0

Use the dateFormat library by Steven Levithan. It's just 1.2kb when minified and gzipped.

Here's how to use it:

var _date = dateFormat(new Date(), "dddd dd mmm yyyy hh:MM TT"); //use _date variable to display
Nishant Ghodke
  • 923
  • 1
  • 12
  • 21
0

You can also use this JQuery library : Date Format

var now = new Date();
document.write($.format.date(now, "ddd dd MMM yyyy hh:mm a"));