js 时间

界面时钟

function timeGo() {
    setInterval(function () {
        var date = new Date();
        var year = date.getFullYear(); //当前年份
        var month = date.getMonth(); //当前月份
        var data = date.getDate(); //天
        var hours = date.getHours(); //小时
        var minute = date.getMinutes(); //分
        var second = date.getSeconds(); //秒
        var day = date.getDay(); //获取当前星期几
        var ampm = hours < 12 ? 'am' : 'pm';
        $('#time').html(fnW(hours) + ":" + fnW(minute) + ":" + fnW(second));
        $('#date').html('<span>' + year + '/' + (month + 1) + '/' + data + '</span><span>' + ampm + '</span><span>周' + day + '</span>')
    }, 1000)
}
上一篇:解决Error response from daemon: conflict: unable to delete bf6a13bd36ca (must be forced)


下一篇:HDU 2571 命运(简单dp)