JavaScript - Date toSource 方法
说明
此方法返回一个表示对象源代码的字符串。
注意 − 此方法可能并非与所有浏览器兼容。
语法
toSource () 方法的语法如下。
Date.toSource ()
返回值
对于内置 Date 对象,toSource 返回一个字符串 (new Date(...)),表示源代码不可用
对于 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))

javascript_date_object.html