Time Date Type

Source: Internet
Author: User

<! DOCTYPE html>/*push and pop for stack LIFO lifo,unshift and shift for queue FIFO filo*/        varcolors = ["Red", "Blue", "_", "Yellow"]; //alert (typeof colors.tostring ());//string        //alert (typeof colors.valueof ());//object        //alert (typeof colors);//object        //Alert (colors.join ("|"));        //var count = Colors.push ("Black", "green");        //var item = Colors.pop ();        varShift =Colors.shift (); varUnshift = Colors.unshift ("AAA", "BBB"); //alert (item);        //alert (colors);        //alert (shift);//Remove the first red        //alert (colors);        /*//var values = [1, 2, 3, 4, 5];        Alert (Values.reverse ());            /* There are already two methods available for reordering directly in the array: reverse () and sort (). Reverse () Not very good for*/        functionCompare (value1, value2) {if(Value1 <value2) {                return-1; }Else if(Value1 >value2) {                return1; }Else{                return0; }        }        varvalues = [3, 4, 1, 5, 2,-1,-2,-4, 10, 15]; //Values.sort (Compare). reverse ();        //alert (values);        //alert (Values.reverse ());        //alert (values); */                //var y2k = new Date (DATE.UTC (0));        //var allfives = new Date (DATE.UTC (2005, 4, 5, N, +));        ////var somedate = new Date (Date.parse ("May)");        //alert (Y2K);        //alert (allfives);        varDate =NewDate (); functionDatedemo () {varDay ; varx = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; //var d = new Date ();Day =Date.getday (); return(X[day]); }          functionTimedemo () {varh, M; vart = ["Morning", "Afternoon"]; H=date.gethours (); M= h-12; returnM? T[1]: t[0]; } alert (Date.getfullyear ()+ "-" + (Date.getmonth () + 1)             + "-" + date.getdate () + "" + Datedemo () + "" +Timedemo ()+ "" +date.gethours () + ":" + date.getminutes () + ":" +date.getseconds ());functionDatedemo () {varDay ; varx = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; //var d = new Date ();Day =Date.getday (); return(X[day]); }varDate =NewDate (); alert (date.tolocalestring ());//alert (date.tostring ());//alert (date.todatestring ());//alert (date.totimestring ());Alert (date.tolocaledatestring () + Datedemo () +date.tolocaletimestring ()); </script></body>

Time Date Type

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.