Return to Snippet

Revision: 16043
at July 24, 2009 04:40 by jonniespratley


Initial Code
/**
 * 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;
}

Initial URL

                                

Initial Description

                                

Initial Title
JavaScript - MySQL Timestamp

Initial Tags
mysql

Initial Language
JavaScript