
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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