1

How can i change jQuery validate 'date' to mysql format? With the current one, my MySql dates are not valid.

MySQL date format - YYYY-MM-DD

Also, is there a native 'time' validator? Or do you have to add your own method for it?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Biker John
  • 2,621
  • 10
  • 33
  • 52

1 Answers1

0

Mysql can generate ISO date .. if you "use strict" you should be able to use Date.parse in the future but for now check this : https://github.com/csnover/js-iso8601 and use the function for ISO date parsing. For generating ISO from javascript date object check this question : How do I output an ISO 8601 formatted string in JavaScript?

Good luck!

Community
  • 1
  • 1
Houssem El Fekih
  • 230
  • 3
  • 11
  • I am sorry , perhaps I have been hasty in my answer of the question although you have to use DATE_FORMAT(NOW(),'%Y-%m-%dT%TZ') to get ISO date and it's probably easier to do this : http://stackoverflow.com/questions/3075577/convert-mysql-datetime-stamp-into-javascripts-date-format ignoring the second part of regexp – Houssem El Fekih Sep 01 '12 at 22:54
  • Why is this accepted answer? Is it possible to change format of date in JQuery validate ? – Ivan Marjanovic Dec 18 '12 at 16:09