Phương thức toSource() trả về chuỗi đại diện cho mã nguồn tạo ra đối tượng Date (chỉ hỗ trợ Firefox/SpiderMonkey).
Ví dụ
<html>
<head>
<title>JavaScript toSource() Method</title>
</head>
<body>
<script>
var dt = new Date(2018, 0, 15, 14, 39, 7);
document.write("Formatted Date: " + dt.toSource());
</script>
</body>
</html>