function unixTime2ymd(intTime){
// var d = new Date( intTime );
↓↓↓↓↓↓↓ あなたの記事の内容
var d = new Date( intTime );
var year = d.getFullYear();
───────
var d = new Date( intTime );
var y = new Date( intTime * 1000 );
var year = y.getFullYear();
↑↑↑↑↑↑↑ 編集リクエストの内容
var month = d.getMonth() + 1;
var day = d.getDate();
var hour = ( '0' + d.getHours() ).slice(-2);
var min = ( '0' + d.getMinutes() ).slice(-2);
var sec = ( '0' + d.getSeconds() ).slice(-2);
return( year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + sec );
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme