How to format this date type 2010-06-24T00:00:00Z

2020-05-07 09:13发布

How to format this date type 2010-06-24T00:00:00Z to sun,24/06/10 7.15 p.m (CDT) using JavaScript or jQuery.?

sun,24/06/10 7.15 p.m (CDT) is just a format representation which I need and not the actual date of the above string.

2条回答
Melony?
2楼-- · 2020-05-07 09:15

Pretty simple with JS -

var d_names = new Array("sun", "mon", "tue", "wed", "thu", "fri", "sat");
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
curr_month++;
var curr_year = d.getFullYear();
document.write(d_names[curr_day] + ", " +curr_month + "/" + curr_date + "/" + curr_year);

and bob's your uncle...

查看更多
Juvenile、少年°
3楼-- · 2020-05-07 09:16

I recommend jQuery Globalization Plugin from Microsoft

http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalization-plugin-from-microsoft.aspx

example:

jQuery.format(new Date(1955,10,5), "dddd MMMM d, yyyy"); // Saturday November 5, 1955
查看更多
登录 后发表回答