如何将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...
热门推荐
10 低调祝福语简短10字
11 宝子生日祝福语简短
12 婆婆生日祝福语短语简短
13 下雨开工吉祥祝福语简短
14 简短朋友旅行祝福语大全
15 简短送嫂子生日祝福语
16 股市祝福语简短10字
17 祝女性生日祝福语简短
18 幼儿狗年祝福语大全简短