js或者JQ 如何把一个时间转换成只显示 月跟日呢?

比如一个时间2019-01-01如果用js 或者jq把他转换成 只显示01-01 呢?
2025-04-09 07:57:51
推荐回答(1个)
回答1:

function fmt(date){
var d = new Date(date)
return `${a.getMonth()+1}-${a.getDate()}`
}