ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 4-26、如何取得年月日,小时分秒? ``` Calendar c=Calendar.getInstance(); c.set(Calendar.YEAR,2004); c.set(Calendar.MONTH,0); c.set(Calendar.DAY_OF_MONTH,31); System.out.println(c.get(Calendar.YEAR)+" "+(c.get(Calendar.MONTH)+1)+" "+c.get(Calendar.DAY_OF_MONTH)); ```