<html>
<body>
日期: <input type="datetime-local" id="myLocalDate">
<p>点击按钮设置日期字段的本地日期和时间。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myLocalDate").value = "2014-01-02T11:42:13.510";
}
</script>
</body>
</html>