Javascriptで現在の日付を取得する方法

参考コード:
<script language="javascript">
var d = new Date()
var objYear = d.getFullYear()
var objMon = d.getMonth() + 1
var objDay = d.getDate()
var h = d.getHours();
var m = d.getMinutes();
var se = d.getSeconds();
s=objYear+(objMon<10 ? “0" + objMon : objMon)+(objDay<10 ? “0"+ objDay : objDay)+(h<10 ? “0"+ h : h)+(m<10 ? “0" + m : m)+(se<10 ? “0" +se : se);
document.write(s);
</script>

JavaScript

Posted by arkgame