I've a function that send ajax request to a server file with parameters. Problem is i want to send current DateTime value to compare it from database.
as MySQL datatime format all datetimes are shown as "2012-02-03 19:50:28" format.
How can i generate it in Javascript.
Another question: Can i add hours to current datetime (to fix server time zone problem)
Thanks in advance
try this
Refernece:
date format
date type in javascript
working with dates
Parse date to your format string, you can do it by the Date API or use Datejs (a powerful date plugin).
But I recommend you push millisecond number to server/mysql instead of string :
Try this: