1. 程式人生 > >個人喜好的時間戳轉換時間js

個人喜好的時間戳轉換時間js

urn etl body localtime post class () oca htm

html的js中寫入以下代碼,引用
getLocalTime();

function getLocalTime(nS) {
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
}

個人喜好的時間戳轉換時間js