time to deal with 2 js

2010-11-11  来源:本站原创  分类:Web  人气:75 

//js Time of the addition
//7 Days of milliseconds
var interval = 7*24*60*60*1000;
var now = new Date();
// Plus 7 days
now.setTime(now.getTime()+interval);

// The js time object is converted to a string  yyyyHHddhhssmm
        function jsTimeToString(time){
                var year=time.getYear();
                var month=time.getMonth()+1;
                var day=time.getDate();
                var hour=time.getHours();
                var minute=time.getMinutes();
                var second=time.getSeconds();
                //alert(year+""+month+""+day+""+hour+""+minute+""+second);
                var strTime = year+""+month+""+day+""+hour+""+minute+""+second;
                return strTime;
        }

        // Converts a string into a js object of time  ,   String format  yyyyHHddhhssmm
        function stringToJsTime(time) {
                var y = time.substring(0,4);
                var m = time.substring(4,6)-1;
                var d = time.substring(6,8);
                var h = time.substring(8,10);
                var mm = time.substring(10,12);
                var ss = time.substring(12,14);
                var date = new Date(y,m,d,h,mm,ss,0);
                return date;
         }
相关文章
  • time to deal with 2 js 2010-11-11

    //js Time of the addition //7 Days of milliseconds var interval = 7*24*60*60*1000; var now = new Date(); // Plus 7 days now.setTime(now.getTime()+interval); // The js time object is converted to a string yyyyHHddhhssmm function jsTimeToString(time){

  • Ext project summary 2009-03-08

    <Private http://www.javaeye.com/topic/320633> Recently, ext finally make use of a small web project. Ext used for the first time to do the project, after all, lack of experience, just write down a number of development ideas and required attention.

  • ext summary 2009-05-04

    Recently, ext finally make use of a small web project. First project to use ext to do, after all, lack of experience, just write down a number of development ideas and required attention. Ext Js 2.2 + Spring 2.5, not using struts, hibernate 1) direct

  • The first experience with joomla made site 2010-10-04

    Made their first website is the first time using joomla. Website is http://www.renminkaiguan.com site now in promotion among the open now while referring to the next site design and development of their own have learned the way to be a record. First-

  • Word template with a program to copy a table and then populate the data into multiple tables (an example of payroll) 2010-10-12

    In the Web system development, when the contents of word document control needs, there will be such a demand: the template is only one form, but the need to query the database record by the number of filled forms. If you put this record is a record o

  • mongoDB in action (2) 2011-04-29

    Getting and Starting MongoDB MongoDB almost running as Network Service, clients can access and manipulate, to start mongodb, run the executable file mongod $. / Mongod . / Mongod - help for help and startup options Sun Mar 28 12:31:20 Mongo DB: start

  • query learning (1) js and animation to deal with 2009-11-07

    query learning (1) js and animation to deal with

  • Gecko (jrex) study the contents of record page JS AJAX crawl to deal with (1) 2009-06-29

    JS AJAX site in order to solve the problem must be a user to simulate the behavior to get the page to display data in the simulation of user behavior, we need to address two things: 1, has been rendering the page after the HTML code in general in you

  • js to deal with the problem of rounding 2009-09-26

    function round (num, n) ( var dd = 1; var tempnum; for (i = 0; i <n; i + +) ( dd *= 10; ) tempnum = num * dd; tempnum = Math.round (tempnum); return tempnum / dd; )

  • js regular operation, can be used for web-side-out deal 2010-10-16

    function ScreenSaver(settings){ this.settings = settings; this.nTimeout = this.settings.timeout; document.body.screenSaver = this; // link in to body events document.body.onmousemove = ScreenSaver.prototype.onevent; document.body.onmousedown = Screen

  • js time to deal with 2010-11-11

    / ** * Function: 2010-10-12 14:12:03 time string into the form of an object * Parameters: * TimeString Date object; * Returns: * Date object * For example: * ToTime ("2010-10-12 14:12:03"); * / function toTime (timeString) { var y = timeString.s

  • Chinese FckEditor V2.6 fckconfig.js Notes 2009-03-09

    Chinese FckEditor V2.6 fckconfig.js Notes Common Description: 1.FCKConfig.SkinPath = FCKConfig.BasePath + 'skins / default /'; this is to control the style of the fck editor, there are other two options, one is office2003 style, there is a gray-style

  • JS handle selected value 2009-03-13

    JS radio button to obtain the value of <label> <input type="radio" name="radio" value="1-10 Years old "> 1-10 years old </ label> <label> <input type="radio" name="radio" value=&

  • DWR util.js 2009-03-15

    DWR util.js Study Notes /********************/ /********************/ util.js contains some useful function function, used to call on the client page. Main function is as follows: Code 1, $ () access to the page parameter value 2, addOptions and remo

  • JS by scaling picture 2009-03-16

    Web design or programming at how the most convenient way to deal with the wide picture high in order to achieve the best effect, this question a lot of trust production staff pages are encountered, the most troublesome of the most time is spent mappi

  • 3D JS collection of related websites 2009-03-19

    http://www.c3dl.org/ The Canvas 3D JS Libary (C3DL) is a javascript library that will make it easier to write 3D applications using canvas 3d. It will provide a set of math, scene, and 3d object classes to make the canvas more accessible for develope

  • About js control automatic telescopic iframe problem 2009-04-02

    http://blog.csdn.net/teachy521/archive/2008/12/02/3429102.aspx Through Google search iframe highly adaptive, resulting in more than 5W, search iframe highly adaptive, resulting in more than 2W. I turned in front of dozens of articles, many reprinted

  • Friday. DWR unusual deal with cross-domain access 2009-04-02

    Sixth DWR abnormal stresses to deal with cross-domain access Abnormal converter Writing in our server-side business logic, when, usually will make use of try () catch () catch the exception, but now call the Front Desk Backgrounds for business logic,

  • Js regarding automatic telescopic control iframe problem 2009-04-04

    http://blog.csdn.net/teachy521/archive/2008/12/02/3429102.aspx Through Google search iframe highly adaptive, resulting in more than 5W, search iframe highly adaptive, resulting in more than 2W. I turned in front of dozens of articles, many reprinted

  • jsp decrypt encrypted js 2009-06-30

    I have been asked in recent js encryption decryption jsp, I access the relevant information, not found jsp directly js encryption decryption methods, but I have the code below to resolve this issue: / ** * Here is the address bar jsp and js Chinese e