Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to convert JS date time to MySQL datetime?
We can convert JS date time to MySQL datetime with the help of toISOString() function.
Let us see an example of JavaScript.
Example
<!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>
Output
The following is the output.
2018-11-23 11:14:38 Current Date is displayed above...
Advertisements
