Copy Code code as follows:
var date = function (A, s) {
var d = s? New Date (s): new Date (), F = d.gettime ();
Return (' + a '). Replace (/a| a|d| d| F|g| g|h| h|i| i|j|l| l|m| m|n|s| S|t| T| u|w|y| y|z| z/g, function (a) {
Switch (a) {
Case ' A ': Return D.gethours () > 11? ' PM ': ' AM ';
Case ' A ': Return d.gethours () > 11? ' PM ': ' AM ';
Case ' d ': Return (' 0 ' + d.getdate ()). Slice (-2);
Case ' D ': return [' Sun ', ' Mon ', ' Tue ', ' Wed ', ' Thu ', ' Fri ', ' Sat '] [D.getday ()];
Case ' F ': return [' January ', ' February ', ' March ', ' April ', ' may ', ' June ', ' July ', ' August ', ' September ', ' October ', ' Nov ' Ember ', ' December ' [D.getmonth ()];
Case ' G ': return (s = (d.gethours () | |)) > 12? S-12:s;
Case ' G ': return d.gethours ();
Case ' H ': return (' 0 ' + (s = d.gethours () () > S-12:s)). Slice (-2);
Case ' H ': Return (' 0 ' + d.gethours ()). Slice (-2);
Case ' I ': return (' 0 ' + d.getminutes ()). Slice (-2);
Case ' I ': return (function () {d.setdate (1); D.setmonth (0); s = [D.gettimezoneoffset ()]; D.setmonth (6); s[1] = D.gettime Zoneoffset (); D.settime (f); return S[0] = = s[1]? 0:1; })();
Case ' J ': Return D.getdate ();
Case ' l ': return [' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '] [D.getday ()];
Case ' L ': return (s = d.getfullyear ())% 4 = 0 && (s%!= 0 | | s% 400 = 0)? 1:0;
Case ' m ': return (' 0 ' + (d.getmonth () + 1)). Slice (-2);
Case ' M ': return [' Feb ', '] ', ' the ' Mar ', ' Apr ', ' may ', ' June ', ' o ', ' Aug ', ' Sep ', ' Oct ', ' Nov ', ' Dec ' [D.getmonth ()];
Case ' n ': Return D.getmonth () + 1;
Case ' s ': Return (' 0 ' + d.getseconds ()). Slice (-2);
Case ' S ': return [' th ', ' st ', ' nd ', ' Rd '] [(S = D.getdate ()] < 4 s:0];
Case ' t ': return (function () {d.setdate (), S = 32-d.getdate (); D.settime (f); return s;}) ();
Case ' T ': return ' UTC ';
Case ' U ': return (' + f '). Slice (0,-3);
Case ' W ': Return D.getday ();
Case ' Y ': return (' + d.getfullyear () '). Slice (-2);
Case ' Y ': return D.getfullyear ();
Case ' Z ': Return (function () {d.setmonth (0), Return D.settime (F-d.setdate (1))/86400000;}) ();
Default:return-d.gettimezoneoffset () * 60;
};
} );
};