此方法返回表示对象的字符串,注意-此方法可能与所有浏览器不兼容。
Date.toSource ()
对于内置的Date对象,toSource返回一个字符串(new date(.))
链接:https://www.learnfk.comhttps://www.learnfk.com/javascript/date-tosource.html
来源:LearnFk无涯教程网
对于Date,toSource返回表示源字符串。
<html> <head> <title>JavaScript toSource Method</title> </head> <body> <script type="text/javascript"> var dt=new Date(1993, 6, 28, 14, 39, 7); document.write( "Formated Date : " + dt.toSource() ); </script> </body> </html>
运行上面代码输出
Formated Date : (new Date(743850547000))
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)