如何将JS日期时间转换为MySQL日期时间?
我们可以借助toISOString()函数将JS日期时间转换为MySQL日期时间。
让我们看一个JavaScript的例子。
示例
<!DOCTYPE html>
<html>
<head>
<title>Web Page Design</title>
<script>
document.writeln(new Date().toISOString().slice(0, 19).replace('T', ' '));
</script>
</head>
<body>
<br>Current Date is displayed above...
</body>
</html>输出结果
以下是输出。
2018-11-23 11:14:38 Current Date is displayed above...
热门推荐
4 送米的祝福语简短
10 七十年祝福语简短
11 忌日祝福语简短10字
12 下午微信祝福语简短
13 关于旅游的简短祝福语
14 冬至宾馆祝福语简短独特
15 预祝中秋简短的祝福语
16 3.8祝福语简短的词语
17 艾伦老师祝福语简短
18 可爱生日祝福语 简短