The following returns time in microseconds, for example 4565212462.
alert( $.now() );
How do I convert it to a human readable time format,
For local time in ISO8601 for SQL TIMESTAMP you could try:
ISO8601
TIMESTAMP
var tzoffset = (new Date()).getTimezoneOffset() * 60000; var localISOTime = (new Date(Date.now() - tzoffset)) .toISOString() .slice(0, 19) .replace('T', ' '); $('#mydatediv').val(localISOTime);