One:
System Current Time
Function Show () {
var mydate = new Date ();
var str = "" + mydate.getfullyear () + "year";
str + = (mydate.getmonth () +1) + "month";
str + = Mydate.getdate () + "Day";
Str+=mydate.gethours () + "when";
Str+=mydate.getminutes () + "min";
Str+=mydate.getseconds () + "seconds";
return str;
}
function Show1 () {
function P (s) {
return s < 10? ' 0 ' + s:s;
}
var mydate = new Date ();
Get when the year before
var year=mydate.getfullyear ();
Get Current Month
var month=mydate.getmonth () +1;
Get Current day
var date=mydate.getdate ();
var h=mydate.gethours (); Get current number of hours (0-23)
var m=mydate.getminutes (); Gets the current number of minutes (0-59)
var s=mydate.getseconds ();
var now=year+ '-' +p (month) + "-" +p (date) + "" +p (h) + ': ' +p (m) + ":" +p (s);
return now;
}
Console.log (Show1 ())
Console.log (Show ())
Output Result:
Non-original;
Two:
Getquerystring:function (name) {
var reg = new RegExp ("(^|&)" + name + "= ([^&]*) (&|$)", "I");
var r = window.location.search.substr (1). Match (REG);
Console.log (r, ' URL ')
if (r! = NULL && r! = undefined) {
Return unescape (r[2]);
}else{
return null;
}
},
Ps:name is the key value;
Gets the current system time + gets the current URL key value;