/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * I make a mysql date timestamp * @deprecated - Datepicker used instead * @param {Object} dateobj - a date */ function jps_makeTimestamp( dateobj ) { var date = new Date( dateobj ); var yyyy = date.getFullYear(); var mm = date.getMonth() + 1; var dd = date.getDate(); var hh = date.getHours(); var min = date.getMinutes(); var ss = date.getSeconds(); var mysqlDateTime = yyyy + '-' + mm + '-' + dd + ' ' + hh + ':' + min + ':' + ss; return mysqlDateTime; }