美文网首页
Date()-Math()-2

Date()-Math()-2

作者: 冰激凌_db91 | 来源:发表于2017-03-09 14:20 被阅读0次

1:构造函数方法:Dtae().now()以毫秒返回当前时间。==new Date().getTime();
2:Date().parse()将里面的日期转换位毫秒。
3:日期返回有这么多的道道:返回字符串。
4:data().toTimeSting();toLocalTimeString(),h.toLocaleDateString();2017/3/9
5:h.toJSON():将日期返回json字符串。"2017-03-09T04:06:10.173Z
6:h.toISOString();:创建一个最完整的时间。"2017-03-09T04:06:10.173Z
7:h.vauleOf():日期对象可以转换为数字,这样在两个时间之间比出大小。
8:new Date(0):返回最一开始的时间。
9:设置未来的时间。1. var future=new Date();
future.setDate(future.getDate()+10);
10:Math为众多的数学函数提供了命名空间。
11:Math.E.还有那些对数有什么用啊。。
12:Math.abs()绝对值。Mtah.ciel()上最大。Math.floor()下最大。Math.round()四舍五入。
13:Math.pow(x,y);x的y次幂。Math.sqrt()返回根号。
14:Math.round() 0-1的随机数。
15:返回特定范围的整数的函数。

相关文章

网友评论

      本文标题:Date()-Math()-2

      本文链接:https://www.haomeiwen.com/subject/pzsigttx.html