[JavaScript] 时间戳格式化为yyyy-MM-dd日期
function formateDate(timestamp){ var date = new Date(timestamp); var y = 1900+date.getYear(); var m = "0"+(date.getMonth()+1); var d = "0"+date.getDate(); return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length); }
------------------------------------------------------------------
Always put yourself in the other's shoes.If you feel that it hurts you,it probably hurts others,too.------------------------------------------------------------------