如何将 JS 日期时间转换为 MySQL 日期时间?
mysqlmysqli database更新于 2025/1/28 14:04:17
我们可以借助 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...
相关文章
有用资源
mysql 参考教程 - 该教程包含有关 mysql 的更多信息:https://www.cainiaomax.com/mysql/

