/** * 作者:chianvane * 时间:2015-1-6 * 功能:Js时间内容的处理 */ formatterDate = function(date) { var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate(); var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0" + (date.getMonth() + 1); return date.getFullYear() + '-' + month + '-' + day; }; function getDate(){ return formatterDate(new Date()); }