I\'m inserting a date in a database in two different format.
this is inserting as Datetime
var mydate; mydate = new Date();
Just if someone else face the same issue and visit this question.
There is a solution here: https://stackoverflow.com/a/28149561