1.315360000000 ms = 10
2.Javascript take time Cut:
JavaScript gets the current timestamp: The first method: var timestamp = date.parse (new date ()); results: 1280977330000 the second method: var timestamp = (new date ()). ValueOf (); results: 1280977330748 The third method: Var timestamp=new Date (). GetTime (); results: 1280977330748 The first: The time stamp obtained is the change of milliseconds to 000 display, The second and third is to get the timestamp of the current millisecond.
The new date in 3.Javascript represents the current time!!! Equivalent to C # DateTime.Now
var mydate = new Date ();
4. C # notation for Math.random () in javascript:
equivalent of Math.random () in Javascript//get A-bit double value x, 0 < x < 1, eg:0.68637410117610087public do Uble mathrandom () {Random RDM = new Random ();d ouble betweenzerotoone17bit = RDM. Nextdouble (); return betweenzerotoone17bit;}
5.
Number.tostring (): Converts a number to a string. The cardinality or base specified with its parameters (the baseline range is 2-36). If the argument is omitted, the cardinality 10 is used. When the parameter value is 2 o'clock, a binary number is returned.
Example code four:
Result: Displayed in the browser:
34
100010
42
22
<script type= "Text/javascript" > var a =; document.write (a.tostring () + "<br/>"); document.write (a.tostring (2) + "<br/>"); document.write (a.tostring (8) + "<br/>"); document.write (a.tostring (+) + "<br/>"); </script>
JavaScript Small Notes