Java实现输出此时此刻
Posted 爱吃鱼的猫#
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java实现输出此时此刻相关的知识,希望对你有一定的参考价值。
function date() { let weekday = []; weekday[0] = "周日"; weekday[1] = "周一"; weekday[2] = "周二"; weekday[3] = "周三"; weekday[4] = "周四"; weekday[5] = "周五"; weekday[6] = "周六"; let date = new Date(); let year = date.getFullYear(); let month = date.getMonth() + 1; let day = date.getDate(); let hours = date.getHours(); let minute = date.getMinutes(); let second = date.getSeconds(); let week = weekday[date.getDay()]; console.log(`${year}年${month}月${day}日,${week},${hours}时${minute}分${second}秒`); } date();
以上是关于Java实现输出此时此刻的主要内容,如果未能解决你的问题,请参考以下文章
java缓冲字符字节输入输出流:java.io.BufferedReaderjava.io.BufferedWriterjava.io.BufferedInputStreamjava.io.(代码片段